Created
November 24, 2015 08:53
-
-
Save Yuji-Kuroko/e585859307f7477c6447 to your computer and use it in GitHub Desktop.
Standard backup shellscript.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
src_dir="/path/to/dir" | |
dest_dir="/path/to/dir" | |
backup_dir=`date +'%Y%m%d'` | |
mkdir -p ${dest_dir}/${backup_dir} | |
rsync -a ${src_dir} ${dest_dir}/${backup_dir} | |
# zip archive | |
cd ${dest_dir} && zip -rm ${backup_dir}.zip ${backup_dir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# everyday backup at 22:10 | |
10 22 * * * root /path/to/basic_backup.sh >> /path/to/backup.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment