New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
copy particular folder from one backup vps to another with cron
Hi
I am taking my backups from production server to a backup vps at Backupsy. I also baught another VPS for security with same provider.
I takes backup on Tuesday and on Friday. I want a cron script which will copy all data from first VPS to second VPS.
Can you tell me how can I achieve this?
Regards
Comments
set up ssh pubkey auth, then add to crontab:
Use rsync.
Can you explain me the code please.. also wht --delete will do? I think i should use this rsync in first VPS right? where backup is stored first time?
How can I setup ssh pubkey via commmand line? I know how to via cPanel but not via SSH.
I'm using this to delete original source:
rsync --remove-source-files -e -varuzP ssh destinationuser@destinationserverip:/your/destination/dir
Yes, setup public key, then rsync as mentioned above, or you can use scp (like: scp -P 22 /localserverdir root@destinationserverIP:/destinationdir) and then on destination server setup cronjob to delete old files from your backup dir (like: tmpwatch -m 720 /bckpdir) to delete things created/modiffied older than 30 days. (i can be wrong, its probable)
http://linux.die.net/man/1/rsync