We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,324 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

script backup

how can i create a script to backup sub-directories using Tar & Gzip, define threshold, and SSH file to
remote host

3
Contributors
2
Replies
3 Days
Discussion Span
4 Months Ago
Last Updated
5
Views
dihmen
Newbie Poster
6 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

HAve you considered Rsync over SSH instead?
http://troy.jdmz.net/rsync/

CimmerianX
Posting Pro
525 posts since Jul 2010
Reputation Points: 49
Solved Threads: 65
Skill Endorsements: 10

yes you can go through rsync but as you are interested in ssh...

its easy to prepare a script for tarring then zipping and then do scp...

What is the threshold you are talking about ? is it the size if it is so

use

size = du -s <directory name> | awk '{print $1}' ---> To store the file size in variable size.

Then check if the variable size is more than your threshold. If it is you can proceed with tar then zip then scp and then recreate the directory.

ashiiiish
Light Poster
36 posts since Jun 2011
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0670 seconds using 2.63MB