Set up Rsync and Cron Job

create file sync user account(mlmsync for example)

LOG ON AS mlmsync;


create .ssh under user folder
ssh-keygen -b 1024 -t rsa -f /home/mlmsync/.ssh/id_rsa
(do not enter a pass-phrase - leave it blank)
append id_rsa.pub to remote box authorized_keys file
scp /home/username/.ssh/id_rsa.pub [email protected]:/home/username/.ssh/authorized_keys


sync all files under /home/vhosts/xxxx.com/logs/ to directory /home/mlmsync
rsync --progress -vrae 'ssh -p 2200' /home/vhosts/xxxx.com/logs/ [email protected]:/home/mlmsync
rsync -vrae 'ssh -p 2200' /home/vhosts/xxxx.com/logs/ [email protected]:/home/mlmsync


rsync --progress -vrae 'ssh -p 2200' /home/asseenon/logs/ [email protected]:/home/mlmsync
rsync -vrae 'ssh -p 2200' /home/drtvvide/logs/ [email protected]:/home/mlmsync

 

Set up Cron Job:

 

crontab -e

 

0 3 * * * mlmsync  rsync -vrae 'ssh -p 2200' /home/vhosts/xxxx.com/logs/tmp/ [email protected]:/home/mlmsync/awstats

發佈了33 篇原創文章 · 獲贊 1 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章