Archiving Cron Job


 
Thread Tools Search this Thread
Top Forums Web Development Archiving Cron Job
# 1  
Old 03-10-2011
Archiving Cron Job

Hi all,

I have a website that constantly logs. There are thousands of log files a month. Because of the large number of files the site is super slow. My first solution was to delete files 30 days or older. That is no longer a viable solution, I would like to keep the files.

After some thought a better solution would be a CRON job that will zip up the files monthly (or bi-weekly), then place them in a sub-directory. I guess name it using the date the zip was created.

I Googled for a while before coming here to ask. I might have been searching for the wrong thing; if there is already a tutorial out please point me in the right direction.

Thanks,
MrDude
# 2  
Old 03-10-2011
I think you should look at logrotate instead of using a cron job.
# 3  
Old 03-10-2011
Cron Job Still

Thanks for the reply Flexy. I am sticking with the cron job because I have another site the incrementally storage images... in the same manner. And would like to back those up as I stated with this Cron Job Script. But I will keep "logrotate" in my memory banks. Smilie MrDude
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cron job - Need to run Cron every quarter at particular time

Hi, 1) If some job supposed to run on 1st of every month at 7 AM In cron job when we have a blackout on the 1st ( i.e when 1st falls on a sunday ) how can we make the job run the next business day? 2) How can we run a job on 25th of every quarter 7 AM(jan,apr,jul,oct) And if 25th... (5 Replies)
Discussion started by: System Admin 77
5 Replies

2. Shell Programming and Scripting

Commented cron job -- cron monitoring

Hi I have a requirement to write a shell script,that will check the all commented job in cron job.Please help !! (2 Replies)
Discussion started by: netdbaind
2 Replies

3. Solaris

Cron job running even after cron is removed

Hi , I have removed a cron for particular user , but cron job seems to be running even after the cron entry is removed. The purpose of the cron was to sendmail to user ( it uses mailx utility ) I have restarted cron and sendmail service still user is getting mail alerts from the cron job. And... (4 Replies)
Discussion started by: chidori
4 Replies

4. Shell Programming and Scripting

CRON Job

Hi all, Pretty new to CRON but have been messing with Ubuntu for a while now Here is the situation/problem I have run into you. I currently run a very basic back procedure by executing a daily CRON job which copies all data from one directory to a USB drive & date stamps the copy:- cp... (2 Replies)
Discussion started by: 2scoops
2 Replies

5. UNIX for Dummies Questions & Answers

Cron job

Hi everybody I have created cron job called it CleanDir.txt, it contains the following command: rm /home/net-group/control-room/* to delete all files inside and I have saved it in /home/net-group/ after that I used crontab -e to edit crontab 40 8 * * * /home/net-group/CleanDir ... (2 Replies)
Discussion started by: bintaleb
2 Replies

6. UNIX and Linux Applications

Help regarding a cron job

Hi, I need to write cron job, which tries to build a project. It would check out code from a repository and then will attempt to build it .The results of the build would show up on a web-page (a table with rows, one for each build, should get updated; a link to the detailed log file; color green... (3 Replies)
Discussion started by: sat411
3 Replies

7. Solaris

cron job starts new cron proccess

I run cron in solaris 10 zone. One cron job which syncing files to nfs mounted on container, creates after finishing another cron proccess(/usr/sbin/cron), and after 100 existing cron proccesses next cron job will not start. It's too weird for me, I'm not able to solve this problem. Theoretically... (3 Replies)
Discussion started by: ron76
3 Replies

8. Solaris

cron job

hi, how i woulsd be able to find that my cron job is running or not.. E.g abc (2 Replies)
Discussion started by: sam.whocares
2 Replies

9. UNIX for Dummies Questions & Answers

CRON usage for CRON job

can anybody explain the usage of CRON for adding a cron job. please provide an example also for better understanding !!! Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies

10. Shell Programming and Scripting

cron job

Hi Gurus I need to add a new cronjob to a list. There are already 7-8 cronjobs when I do crontab -e. I need to add a new cronjob without disturbing the existing ones. Can you please tell me how to do that. I am not so good in vi editor as well, but I can do it with some guidance. this is urgent,... (3 Replies)
Discussion started by: ragha81
3 Replies
Login or Register to Ask a Question