rsync client backup scripts
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了rsync client backup scripts相关的知识,希望对你有一定的参考价值。
#!/bin/bashBackup_dir="/backup"
IP_info=$(hostname -i | awk -F ‘ ‘ ‘ print $2 ‘)
Create Backup Dir
mkdir -p $Backup_dir/$IP_info
Tar backup Data
cd /
tar -zchf $Backup_dir/$IP_info/systembackup$(date +%F_week%u -d -1day).tar.gz ./etc/rc.local
day 7 ago data
find $Backup/$IP_info/ -type f -mtime +7 | xargs rm 2>/dev/null
create finger file
find $Backup_dir/$IP_info -type f ! -name "finger*" | xargs md5sum > $Backup_dir/$IP_info/finger.txt
push Backup_data to Backup_server info
rsync -avz $Backup_dir/ [email protected]::backup --password-file=/etc/rsync.passwd
以上是关于rsync client backup scripts的主要内容,如果未能解决你的问题,请参考以下文章