VE Backups [message #1888] |
Sat, 04 March 2006 04:31 |
scooter
Messages: 38 Registered: December 2005 Location: Texas
|
Member |
|
|
Anyone got any little scripts to run backups of ve's on the server?
At this time, I'm just doing a rsync of /vz/private and the vz-scripts directory to a 2nd drive.
Any suggestions would be appreciated.
Scooter
Scooter Harris
|
|
|
|
Re: VE Backups [message #1904 is a reply to message #1888] |
Sun, 05 March 2006 22:31 |
scooter
Messages: 38 Registered: December 2005 Location: Texas
|
Member |
|
|
Yes, that would work, but alot of work when you have quite a few ve's heh
Also i would have to manually go remove old backups unfortunately.
Scooter
Scooter Harris
|
|
|
|
Re: VE Backups [message #1906 is a reply to message #1888] |
Sun, 05 March 2006 22:56 |
scooter
Messages: 38 Registered: December 2005 Location: Texas
|
Member |
|
|
Any way to do it where it will do all the ve's without having multiple crons?
And maybe keep less amount of days?
Scooter Harris
|
|
|
Re: VE Backups [message #1907 is a reply to message #1888] |
Sun, 05 March 2006 23:45 |
Valmont
Messages: 225 Registered: September 2005
|
Senior Member |
|
|
It is not complex
#!/bin/sh
vzprivate="/run/vz/private"
backupdir="/run/backup"
for x in `ls $vzprivate` ; do
cd $vzprivate/$x; tar -czf $backupdir/vps.$x.`date +%a`.tgz .
done
And you could start it by cron so often, how much it is necessary for you. Also you could use nice for downturn of a priority of it.
[Updated on: Sun, 05 March 2006 23:53] Report message to a moderator
|
|
|
Re: VE Backups [message #1908 is a reply to message #1888] |
Sun, 05 March 2006 23:53 |
scooter
Messages: 38 Registered: December 2005 Location: Texas
|
Member |
|
|
What about keeping less days than a week, is that something simple?
Scooter Harris
|
|
|
|
Re: VE Backups [message #1910 is a reply to message #1888] |
Mon, 06 March 2006 00:10 |
scooter
Messages: 38 Registered: December 2005 Location: Texas
|
Member |
|
|
Gotcha, i wasn't thinking of it happening that way.
I'll write something to do it and remove older backups I guess heh
Thank you,
Scooter
Scooter Harris
|
|
|
Re: VE Backups [message #1918 is a reply to message #1888] |
Tue, 07 March 2006 03:05 |
phpfreak
Messages: 47 Registered: January 2006
|
Member |
|
|
You guys should really consider doing rsync instead. Your server loads would be dramatically less during a backup
for i in `ls /vz/private/`; do rsync --progress -var /vz/private/$i /backup/daily --delete-after; done
Then if you wanted weekly run this once a week:
for i in `ls /vz/private/`; do rsync --progress -var /vz/private/$i /backup/weekly --delete-after; done
That should do the trick, but keep in mind you might need some insane disk space to do this, depending on how many vps you have on the system.
Eric Rosebrock
http://www.serverpowered.com
http://www.hybodus.com
http://www.linuxforum.com
http://www.phpfreaks.com
|
|
|
|