cancel
Showing results for 
Search instead for 
Did you mean: 

Cron job that backups log files

luyanda
Champ in-the-making
Champ in-the-making
How to write a cron job/s that does the following.

1) Backs up /opt/alfresco_xx to /opt/alfresco/backups (mount point)
   Include date and time in description (or date and 1, date and 2)
   Use tar in command to compress folder.
   Run cron job at (12:00) pm and 17:30 pm.
2) Checks for backups older than 2 days, and deletes them.
  
   Logs - Run Daily at 19:00 :
3) Stop repository
4) Move logs in /opt/alfresco_xx/tomcat/logs, to opt/alfresco/backups/logs
5) checks for log files, in backup folder, older than 3 days and deletes them
6) Start Repository

Please assist me!!
1 REPLY 1

mitpatoliya
Star Collaborator
Star Collaborator
Looking at your requirement you cannot use Alfresco cron jobs to achieve this.
What you need to do is

create standalone JAVA utility which will do this for you.
Create a batch file which can invoke this utility.
Schedule Window cron job to execute this batch file at your specified time on daily basis.