Hello, please sign in or register
You are here: Home

Crontab logging

Running automatic scripts in the background can be quite a headache to sift through large log files. Large files take up space too. Here is a look at a crontab file which saves any output to a compressed file.

bash /data/path/to/script.sh | gzip >>  /data/path/to/logs/script_logs_$(date +\%d).gz 2>&1 &

Comments

Title*
Comment

Prove you are not a robot

To prove you are not a robot, please type in the six character code you see in the picture below
Security confirmation codeI can't see this!
Contact
Name*
Email never shown*
Home Page

Author

Andrew Dodson
Since:Feb 2007

Comment | flag

Categories

Bookmark and Share