1,105,333 Community Members

script backup

Member Avatar
Newbie Poster
6 posts since Jul 2008
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]

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

Member Avatar
Practically a Master Poster
658 posts since Jul 2010
Reputation Points: 53 [?]
Q&As Helped to Solve: 83 [?]
Skill Endorsements: 13 [?]

HAve you considered Rsync over SSH instead?

Member Avatar
Light Poster
36 posts since Jun 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]

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


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.

This article has been dead for over three months: Start a new discussion instead
Start New Discussion
Tags Related to this Article