Ubuntu

Ubuntu: How to Zip Files created on a specific Month

I've got a couple of gigabytes of files created  daily by my Asterisk Server. This files are created on every call (asterisk records all calls) so the memory is full so I would like to create a monthly snapshot of all the files zip them and upload them to a remote server.

 

#To zip the files I use the following command

find '/var/spool/asterisk/monitor' -newermt '2016-05-01' ! -newermt '2016-06-01' -print | zip /var/spool/asterisk/monitor/2016-06.zip -@

 

#To delete the files I have zipped and moved to a remote server i use the following command.

find '/var/spool/asterisk/monitor' -newermt '2016-06-01' ! -newermt '2016-07-01' -print -exec rm {} \;

Attachments:

Leave a Reply

Your email address will not be published. Required fields are marked *