ispCP - Board - Support
Deletion of config backups (cronjob) - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Development Area (/forum-1.html)
+--- Forum: Suggestions (/forum-2.html)
+--- Thread: Deletion of config backups (cronjob) (/thread-2450.html)



Deletion of config backups (cronjob) - FeG - 02-15-2008 07:38 PM

Hi all..

I'd like to suggest to change the cronjob which deletes old config backups under /etc/ispcp/*/backup. At the moment (RC3), this command is used:

Code:
# Remove config backups older than seven days
@daily root find /etc/ispcp/*/backup/* -maxdepth 0 -type f -mtime +7 -print | egrep '.*\.[0-9]+$' | xargs -r /bin/rm

Problem is, that - at least on my server - /etc/ispcp/*/backup/* returns to much arguments, so find failes with argument list too long.

Therefore I changed this to:
Code:
# Remove config backups older than seven days
@daily root find /etc/ispcp/*/backup/ -maxdepth 1 -type f -mtime +7 -print | egrep '.*\.[0-9]+$' | xargs -r /bin/rm

.. which should work.

Greetings,
FeG