^thehatsrule^

Group: Members
Posts: 3275
Joined: July 2006 |
 |
Posted: Jan. 22 2008,19:53 |
 |
If I get what you mean, it can be something like (using easy-to-read/change variables to see what it does):
Code Sample | folder_to_backup="/path/to/myfolder" backup_name="mybackupname" backup_location="/path/to/mybackuplocation"
backup_name="${backup_name}-`date +%a`.tar.gz" cd "$backup_location" rm -f "$backup_name" tar zcvf "$backup_name" "$folder_to_backup" | Basically this will use filenames based on the day of the week... and will remove last week's if it exists before making a .tar.gz out of your specified folder.
Quote | For instance I have no idea why the OSX script would be bad. | At first glance, I think it was a reference to the if-statements.
fyi: this seems more of a scripting thread than a mydsl one...?
|