Page 1 of 1

Delete ALL Recordings till January

PostPosted: Thu Mar 04, 2010 7:42 am
by gmcust3
On next reboot, I want to DELETE ALL recordings till January End. Cron has it but it says about 7 days. I can change it to 60 days and reboot, and it will delete all ?

Before that I want to take Back Up all in another HDD.

Do I need to attach another HDD and then FTP ?

Another HDD can be WINDOWS ?

Re: Delete ALL Recordings till January

PostPosted: Thu Mar 04, 2010 8:37 am
by brett05
gmcust3 wrote:On next reboot, I want to DELETE ALL recordings till January End. Cron has it but it says about 7 days. I can change it to 60 days and reboot, and it will delete all ?

Before that I want to take Back Up all in another HDD.

Do I need to attach another HDD and then FTP ?

Another HDD can be WINDOWS ?


very simple look the syntaxe of crontab here :
### remove old recordings more than 7 days old
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +2 -print | xargs rm -f

first delete comment of this ligne as this:
### remove old recordings more than 7 days old
24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +2 -print | xargs rm -f

then to spécify number of day use this :
for exemple if we to delete all file from /var/spool/asterisk/monitorDONE with the number of days old that the folder of recording you need just change this : -mtime +2 to the number of days .
exemple for 30 days change it to :-mtime +30
:wink:

PostPosted: Thu Mar 04, 2010 11:43 am
by gmcust3

Before that I want to take Back Up all in another HDD.

Do I need to attach another HDD and then FTP ?

Another HDD can be WINDOWS ?



Any Suggestions on this ?