- Mount tự động thư mục file share
Thêm cấu hình vào fstab
//10.128.8.114/AutoBackup /home/acct cifs auto,username=backup,password=It12345! 0 0
- Cấu hình file run_backup.sh
find /home/acct/* -mtime -7 -exec cp {} /home/acct_backup/ \; find /home/acct_backup/* -mtime +30 -exec rm {} \;
-
Đặt lịch tự động backup trên Centos6.9
crontab -u root -e 59 23 * * 6 /bin/sh /home/acct_backup/run_backup.sh