Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Created by Russell John (https://russelljohn.net)
- #START
- TIME=`date +%b-%d-%y` # This command will add date in backup filename
- FILENAME=knack-$TIME.tar.gz # Define backup filename format
- SRCDIR=/home/russell # Location of data directory (source of backup)
- DESDIR=/backup/russell # Destination of backup file
- tar -cpzf $DESDIR/$FILENAME $SRCDIR
- find $DESDIR/* -mtime +5 -exec rm -rf {} \;
- #END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement