PDA

View Full Version : Too many archives


Soapm
07-05-2008, 01:15 PM
My root directory is full of files like this;

LOG_ARCHIVE.0602_09:16.tgz

Anybody see why my Cron is not deleting them?

# Sample below creates a test file and updates it with current time and date
# every 5 minutes -- use this for troubleshooting.
# m h dom mon dow command
#*/5 * * * * date >> /var/log/cron.test.out

# Wipe the logs every Sunday night at 3:18am cst
18 9 * * 1 /busybox/wipelogs; echo "`date` logs wiped" >> /var/log/cronlog-main

# Run fakecall every night at 10:20pm cst
#20 4 * * * tivosh /busybox/fakecall.tcl

# Delete the crond log files every 3 months
22 9 1 */3 * rm /var/log/cronlog-main; echo "`date` cron logs wiped">> /var/log/cronlog-main

# Delete cron.test.out every night at 3:24am cst
#22 9 * * * rm /var/log/cron.test.out; echo "`date` cron.test.out deleted" >> /var/log/cronlog-main

# Weekly reboots. Cleans things out for better performance if you have several hacks running
# Also restarts logs, and allows fakecall to reset the last successful call indicator,
# so your Tivo won't call home (fakecall doesn't update mfs entries without a reboot).
# This allows you to keep your phone line connected for callerID and PPV ordering.
# Run safereboot, so reboot only happens when nothing is recording.
#25 9 * * 1,4 echo "`date` SCHEDULED REBOOT"; tivosh /enhancements/safereboot.tcl >> /var/log/cron

# Display 0n-screen warning messages before scheduled reboots
#5 9 * * 1,4 cd /var/hack/bin; echo 'SCHEDULED REBOOT IN 20 MINUTES...' | /var/hack/bin/out2osd -c1
#15 9 * * 1,4 cd /var/hack/bin; echo 'SCHEDULED REBOOT IN 10 MINUTES...' | /var/hack/bin/out2osd -c

# Tarball the logs before deleting them, every Sunday night at 3:16am cst
16 9 * * 1 mount -o remount,rw /; tar -czvf /LOG_ARCHIVE.$(date +%m%d_%H:%M).tgz /var/log/* >> /var

# Delete the LOG_ARCHIVE files every month
18 9 1 * * rm /LOG_ARCHIVE*; echo "`date` LOG_ARCHIVE deleted"; ro >> /var/log/cronlog-main

# Make a backup of season passes and wishlists every Sunday night at 3:30am CST
31 9 * * 1 cd /enhancements; sh backup_run.sh; echo `date` season pass backup made >> /var/log/cron

# Delete season pass backups every month to save on space
29 9 1 * * mount -o remount,rw /; rm -r /seasonpass_backups; ro

14 9 * * * cd /enhancements; sh drivemonitor.sh; echo "Ran DriveMonitor on `date`" >> /var/log/cron

# End of crontab

BTUx9
07-05-2008, 02:01 PM
Looks like the command for purging the archives monthly isn't remounting r/w, first

Soapm
07-05-2008, 07:28 PM
18 9 1 * * rm /LOG_ARCHIVE*; echo "`date` LOG_ARCHIVE deleted"; ro >> /var/log/cronlog-main

I see, so that rm should be RW

Soapm
07-05-2008, 07:32 PM
Or is this command the problme by putting the logs in my /root directory instead of /var/logs

# Tarball the logs before deleting them, every Sunday night at 3:16am cst
16 9 * * 1 mount -o remount,rw /; tar -czvf /LOG_ARCHIVE.$(date +%m%d_%H:%M).tgz /var/log/* >> /var

BTUx9
07-06-2008, 12:19 AM
18 9 1 * * rm /LOG_ARCHIVE*; echo "`date` LOG_ARCHIVE deleted"; ro >> /var/log/cronlog-main

I see, so that rm should be RW
no, if rw is a valid command (NOT an alias), you'd want
18 9 1 * * rw;rm /LOG_ARCHIVE*; echo "`date` LOG_ARCHIVE deleted"; ro >> /var/log/cronlog-main


P.S. putting the log backups in /var/log would be a BAD thing in that new backups would ALSO contain the old backup files, making them grow very quickly in size... personally I've never had a real need for log backups on a tivo, and just let the tivo s/w handle them on its own

Soapm
07-06-2008, 04:25 AM
personally I've never had a real need for log backups on a tivo, and just let the tivo s/w handle them on its own

Now that's the best darn idea I done heard in a long time. :up:

Problem solved... :D

djl25
07-06-2008, 01:24 PM
The one exception I might point out is cidcall.log - I've run across a few people that back up their caller-id log to protect it from wipes. One in particular has over 8000 calls logged, going back years.


personally I've never had a real need for log backups on a tivo, and just let the tivo s/w handle them on its own

BTUx9
07-06-2008, 02:43 PM
The one exception I might point out is cidcall.log - I've run across a few people that back up their caller-id log to protect it from wipes. One in particular has over 8000 calls logged, going back years.In that one exception, backing up the whole log dir seems a poor choice for keeping historical caller ID info.