Are there any alternative scripts to Cpbackup?

AdamDresch

Well-Known Member
Jun 22, 2006
80
0
156
While the basic CPanel backup script works, it is somewhat limited

Ideally it'd be great if there was an option to preserve X number of daily/weekly/monthly backups, instead of the system overwriting the existing ones

Anyone know of a line of code/ing or script which can facilitate that?
 

lorio

Well-Known Member
Feb 25, 2004
308
16
168
cPanel Access Level
Root Administrator
There was another one on the forums, search for a smarter backup script. We quit using it when it the updates for it stopped, but if it might suit your needs.
What are you using now?
 

AdamDresch

Well-Known Member
Jun 22, 2006
80
0
156
There was another one on the forums, search for a smarter backup script. We quit using it when it the updates for it stopped, but if it might suit your needs.
Thanks, yea that's the first one I looked up, but it's no longer available.
 

danielmolano

Registered
Feb 8, 2009
1
0
51
re

are you using wordpress? if so they have a few plugins that will backup everything up..and if not then I'm sorry I dont know..all I know is wordpress.
 

rhenderson

Well-Known Member
Apr 21, 2005
785
2
168
Oklahoma
cPanel Access Level
Root Administrator
You could just write a simple script to copy the files to a different location every night after backup has ran. Not a great way but it could solve your problems. You could rename the old folder before copying the new backups, something along those lines.
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
This script is the one I mentioned previously, it works along similar lines to what rhenderson has suggested.

To make it work, you copy it into /scripts/postcpbackup and it is run after a backup completes successfully. The script rotates daily, weekly and monthly copies keeping N copies of each. You can specify N separately for daily, weekly and monthly through keepdaily/keepweekly/keepmonthly variables, and no copies are made if those variables are set to empty or not set. For instance, the following would keep two copies of daily backups and 3 weeks of weekly and no monthly backups:
Code:
keepdaily=2
keepweekly=3
keepmonthly=
You can put these settings in the script itself or in a file /backup/cpbackup/.postcpbackup

For the script, see www.whitedoggreenfrog.com/scripts - it's the top paragraph at the moment, postcpbackup...
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
Melbourne, Australia
cPanel Access Level
Root Administrator
ps: if you use and like it, could you post here; also if it has bugs, let us know.

The version I have up at the moment uses "tac" but I can change it to use ls -tr instead, just haven't got around to doing it and testing it ...
 

britsenigma

Well-Known Member
Dec 14, 2008
85
0
56
I'm gonna test it out.

First thing I noticed is, if you have your backup folder in another location, you need to make a change to the CD command.

I inserted a variable at the top, although it would be nice if I could pull that variable fromwhere cpanel saves the tweaks data.