Tag Info

Hot answers tagged


The problem is not how you can use date to output what you want... your problem is: This way I'd like to get the old logfiles out of my way, but still have 5-6 days of logfiles around. So, why not using find to remove all files but this week's? find /path/to/files/ -mtime +7 -exec rm {} \; In addition, date has many different implementations - I ...


You would do that like this: date -d "+1 days" +%a That renders: Sat


I would suggest starting off with EventViewer as if it's a crash, it should be logged. You could also add some logging functionality to your program to see which module/task it's failing on. Deleted as realised LPChip wrote similar: Also, as a total work around, in task scheudler, you can force it to quit if it takes more than 72 hours to complete (I ...


After paring the one liner down and removing the notification aspects I discovered that I need to move into the correct directory before running the sha512sum command. So it now looks like this: */5 * * * * cd /var/www; /usr/bin/sha512sum --status -c /sha512.sumlist && echo "Success" > /dev/null || echo "Check robots.txt and ...


Use the -d option to specify a phrase: date -d '+ 1 day' +%a


Another entry for "how to sanely manage your log files".... You can look at logrotate which should be part of most Linux distributions. It can manage deletion and compression. A lot of Linux daemons use this, so you can look at some example config files. A bit simpler is rotatelogs which handles the rotation part, but doesn't do any deletion (your find ... ...

Only top voted, non community-wiki answers of a minimum length are eligible