cron is filling my journal.
Installed cron (because it's what I'm used to. Timers.... not too interested in). I'm running a job every minute to grab some images from my local-only camera server to make them available on my web server that's accessible from the outside world. This setup is working perfectly for me but I am getting too many journal entries. How to stop cron from logging in the journal?
About this post
- Posted
- Archived
- Score
- 3 · 100% up
- Kind
- Text
- ID
- 45c3yi
12 comments
?
It was also emailing me every time (in the beginning) so I added what you've mentioned :
*/1 * * * * /home/user/Apps/getcams.sh &>/dev/null
Now it stopped emailing me but I get this every minute in my journal :
Feb 11 17:57:02 fury-1 CROND[4417]: pam_unix(crond:session): session closed for user root
Feb 11 17:57:01 fury-1 CROND[4418]: (root) CMD (/home/user/Apps/getcams.sh &>/dev/null)
Feb 11 17:57:01 fury-1 crond[4417]: pam_unix(crond:session): session opened for user root by (uid=0)
Yes I am running the job as root, so I don't have to think about permissions here. This was the simplest way I could think of to wget some files over to /srv/http.
I have a script that runs
sudo iwconfigand outputs various wifi info, which I run every 3s and pipe to my status bar (xmobar), so every 3s, I seewhen I run
journalctl -f.I'd be interested to see if anyone knows how to exclude such events from the journal, because I don't know how to.
Using cron to run a shell script every second is abuse of cron IMO.
Just run the script with a loop that calls sleep 1. Create a service file for it and let systemd run it for you.
It was only running every minute, but still.. you're right. In the end I've done what you suggested, a script with a while true loop and sleep 60 running in a service. I found I had to put StandardOutput=null in the service file to get it to shut up, still.
Seconds, minutes, what's the difference? :)
My reading comprehension is proportional to my caffeine intake, apparently.