[Linux] Cronjob rsync 

 
<pre class="lang:default decode:true " >crontab -e

0 23 * * * /usr/local/sbin/rsync_to_other_server.sh
</pre> 

 
<pre class="lang:default decode:true " >vi /usr/local/sbin/rsync_to_other_server.sh

#!/bin/sh
rsync -avzp -e "ssh -p 22" /this_server_folder_path/folder user@172.0.0.1:/the_server_folder_path/</pre> 
 

Back