We can set up an automatic rsync and place the files into daily folders. For this to work we need to setup automatic ssh login first and then use cron to run your bash script.
The base of the automatic rsync is a very simple bash script.
#!/bin/bash
dest=/backup/buddy/`date +%A`
mkdir -p $dest
rsync -e ’ssh -p 2222′ -avl –delete –stats –progress root@192.168.1.1:/home/buddy $dest/
dest=/backup/buddy/`date +%A`
mkdir -p $dest
rsync -e ’ssh -p 2222′ -avl –delete –stats –progress root@192.168.1.1:/home/buddy $dest/
Using Cron to run the above script every day.
# run rsync at 23.00hrs every day
00 23 * * * sh /home/backup/bin/backup
00 23 * * * sh /home/backup/bin/backup
Leave a Reply
You must be logged in to post a comment.