![]() |
[HowTo] How can I keep my backups for x days? - Printable Version +- ispCP - Board - Support (http://www.isp-control.net/forum) +-- Forum: ispCP Omega Contributions Area (/forum-40.html) +--- Forum: Howtos (/forum-41.html) +--- Thread: [HowTo] How can I keep my backups for x days? (/thread-6129.html) |
RE: How can I keep my backups for x days? - MasterTH - 07-29-2009 10:25 PM is it possible to add a feature in this addon which adds a folder or filelist what has to be included in the Backup? RE: How can I keep my backups for x days? - Kami - 08-01-2009 04:13 AM Here is a working and improved version (tested on Debian Lenny). [attachment=837] Obviously previous version threw an error and didn't delete the file on some systems, because file name is the 8th and not 9th parameter in the ls -lrt output. I've also added an --color=never switch, because colors could cause problems with the file names on some systems. Oh, and if you don't want your crontab log file to be filled with the script output, use this cron entry: Quote:0 4 * * * root /var/www/ispcp/engine/backup/sitebackups.php > /dev/null Regards RE: How can I keep my backups for x days? - Kami - 08-04-2009 12:24 AM Here is another version which deletes old backups based on the date in the file name instead of using the file creation date (if something goes wrong and ISPCP doesn't creates new backups old backups will still be deleted). [attachment=838] RE: How can I keep my backups for x days? - MasterTH - 08-04-2009 02:39 PM you could code an counter which counts the files in the backup-folder with tar.gz in the end. If the amount of files is bigger then the number of backups given from the user ispcp can delete the oldest files. RE: How can I keep my backups for x days? - miklosandras - 08-04-2009 05:31 PM I was in vacation, now I am back, thanks for all answers and responses about my topic. I made some change with the script, thanks to Kami! First post updated with new version! (07-07-2009 08:01 AM)FISA4 Wrote: Great work, Now, at reseller level, you can set different values for site and database backups too. "set the value(s) if you create a new user" will be implemented soon. (07-29-2009 03:48 PM)BeNe Wrote: Good Point! So the user should have the ability to select a Backup with a Radio-Button ?! Sorry, I can not create Patch for the current trunk, anyone could help me? Best Regards, Andras RE: How can I keep my backups for x days? - ephigenie - 08-04-2009 07:34 PM i can help with the patch ... For me just one important feature is missing : User should be able to select which backup to use to restore their data. (and of course in combination with the splitting of sql / file data) RE: How can I keep my backups for x days? - Kami - 08-04-2009 07:50 PM (08-04-2009 02:39 PM)MasterTH Wrote: you could code an counter which counts the files in the backup-folder with tar.gz in the end. If the amount of files is bigger then the number of backups given from the user ispcp can delete the oldest files. Yes, that would work as well, but that solution would require 1 extra step. First I would need to count all the files matching the pattern and then I would still need to delete the files based on the date in the file name (assuming that the ISPCP backups are "compromised" and that the file creation date is incorrect). @miklosandras: Great ![]() RE: How can I keep my backups for x days? - miklosandras - 08-04-2009 08:14 PM (08-04-2009 07:34 PM)ephigenie Wrote: i can help with the patch ... Thanks for your help. I know the solution for restore what was in /var/www/ispcp/engine/ispcp-dmn-mngr but, I am not good at perl... RE: How can I keep my backups for x days? - Kami - 08-04-2009 08:40 PM (08-04-2009 08:14 PM)miklosandras Wrote:(08-04-2009 07:34 PM)ephigenie Wrote: i can help with the patch ... There is a one small bug in your script (same as in my first version). Code: exec("ls -lrt --color=never /var/www/virtual/".$domain_name."/archive_backups/ | grep '$delete_day1' | awk '{print $8}' | xargs rm -f"); If you don't change the working directory to /var/www/virtual/".$domain_name."/archive_backups/ you need to supply the full path to the rm command, else script will try to delete these files in the current working directory instead of /var/www/virtual/".$domain_name."/archive_backups/. RE: How can I keep my backups for x days? - miklosandras - 08-04-2009 09:21 PM (08-04-2009 08:40 PM)Kami Wrote:(08-04-2009 08:14 PM)miklosandras Wrote:(08-04-2009 07:34 PM)ephigenie Wrote: i can help with the patch ... Thanks, script updated, and tested, works fine ![]() |