support

delete-backups

These scripts will delete freepbx or trixbox backups older than 30 days.

This one is for freepbx backups (made by the freepbx backup module in admin gui).

type
nano -w /etc/cron.weekly/rmoldbackups.cron
and paste in the following (it should show as only 2 lines of code):

#!/bin/sh
/usr/bin/find /var/lib/asterisk/backups/ -depth -type f -mtime +30 | /usr/bin/xargs /bin/rm -f >/dev/null 2>&1

Then type:
chmod +x !$

You can then test it by typing:
/etc/cron.weekly/./rmoldbackups.cron
This should now run automatically every week.
----------------------------------------------------------------------------------------------------------
This script will delete old trixbox backups (made by the trixbox backup module in Maint gui).

Use the same procedure above to paste it into a new cron job.


#!/bin/sh
/usr/bin/find /var/lib/trixbox/backups/ -depth -type f -mtime +30 | /usr/bin/xargs /bin/rm -f >/dev/null 2>&1

----------------------------------------------------------------------------------------------------------
Wiki Home|Tutorials|Troubleshooting|Additional Scripts and Tricks|Hardware Support