# change cron log level

**URL:** <https://forums.suse.com/t/change-cron-log-level/34256>\
**Category:** SLES Configure-Administer\
**Created:** [August 5, 2019, 5:22pm UTC](https://forums.suse.com/t/change-cron-log-level/34256 "2019-08-05T17:22:52Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gu\_adamski](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@gu\_adamski](https://forums.suse.com/u/gu_adamski)\
**Post date:** [August 5, 2019, 5:22pm UTC](https://forums.suse.com/t/change-cron-log-level/34256/1 "2019-08-05T17:22:52Z")

</div>

I’m trying to figure out how to change the cron log level. Looks like by default only show start time of cron jobs. need to also show end time. How do I configure to due this?

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [August 5, 2019, 5:38pm UTC](https://forums.suse.com/t/change-cron-log-level/34256/2 "2019-08-05T17:38:29Z")

</div>

> [@gu\_adamski;58257](#):
>
> I’m trying to figure out how to change the cron log level. Looks like by default only show start time of cron jobs. need to also show end time. How do I configure to due this?

Hi and welcome to the Forum 🙂  
Consider switching (and future proofing) to systemd services and timers, you will then get a journal entry of when the job started and if it succeeded which show the time stamps.

Do you have an example of the current cron job?

---

<div class="post-metadata">

**Author:** ![gu\_adamski](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@gu\_adamski](https://forums.suse.com/u/gu_adamski)\
**Post date:** [August 27, 2019, 11:44pm UTC](https://forums.suse.com/t/change-cron-log-level/34256/3 "2019-08-27T23:44:28Z")

</div>

Sorry for the delay, been busy with the prep for school year to start, and the notification email of reply got buried.

One job only runs this command nightly.

rm -f /opt/carsi/spool/\*/.spllock

which cleans up some files that our ERP sometime doesn’t auto-delete. I can’t post the actual job per policy here. but is a basic few line job.

You mentions systemd, I don’t know much about that. On HP-UX we use to be able to set the cron log level, and I read some Linux have similar settings. It seems suse doesn’t.

John

---

<div class="post-metadata">

**Author:** ![malcolmlewis](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/malcolmlewis/32/11375_2.png) [@malcolmlewis](https://forums.suse.com/u/malcolmlewis)\
**Post date:** [August 28, 2019, 12:42am UTC](https://forums.suse.com/t/change-cron-log-level/34256/4 "2019-08-28T00:42:55Z")

</div>

[QUOTE=gu\_adamski;58370]Sorry for the delay, been busy with the prep for school year to start, and the notification email of reply got buried.

One job only runs this command nightly.

rm -f /opt/carsi/spool/\*/.spllock

which cleans up some files that our ERP sometime doesn’t auto-delete. I can’t post the actual job per policy here. but is a basic few line job.

You mentions systemd, I don’t know much about that. On HP-UX we use to be able to set the cron log level, and I read some Linux have similar settings. It seems suse doesn’t.

John[/QUOTE]  
Hi John  
Look at scripting your command and add the logger command, eg;

```auto
#!bin/bash
logger "Starting cleanup of spllock"
rm -f /opt/carsi/spool/*/.spllock
logger "Finished cleanup of spllock"
```

You will get an entry like;

```auto
Aug 27 16:35:56 hostname username[13724]: Starting cleanup of spllock
....
....
Aug 27 16:36:07 hostname username[14035]: Finished cleanup of spllock
```

Make executable (chmod 0700) and save the file in /etc/cron.daily you can configure the daily time for cron to run, else save the script somewhere eg /usr/locsl/sbin and call the script with time and date in the crontab.

Use the man page for logger to see other options eg perhaps a /var/log/spllock.log file (don’t forget a logrotate file 😉 )

---

<div class="post-metadata">

**Author:** ![strahil-nikolov-dxc](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@strahil-nikolov-dxc](https://forums.suse.com/u/strahil-nikolov-dxc)\
**Post date:** [September 17, 2019, 8:40am UTC](https://forums.suse.com/t/change-cron-log-level/34256/5 "2019-09-17T08:40:30Z")

</div>

If you just need to cleanup a dir , you can still use the tmpfiles service . For details `man 5 tmpfiles.d`

---

<div class="post-metadata">

**Author:** ![gu\_adamski](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@gu\_adamski](https://forums.suse.com/u/gu_adamski)\
**Post date:** [September 17, 2019, 3:41pm UTC](https://forums.suse.com/t/change-cron-log-level/34256/6 "2019-09-17T15:41:41Z")

</div>

The example job was just that an example. The jobs we would like the start/end times have multiple commands can take hours to run. The people that monitor the jobs liked the fact our old OS (HPUX) allowed the start/end times to be logged. And rather than modify a hundred jobs to somehow do this for each job, they wanted to know if a OS level setting could do it, like in HPUX.

Looks like SUSE doesn’t, but other Linux flavors do.

john

---

<div class="post-metadata">

**Author:** ![strahil-nikolov-dxc](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@strahil-nikolov-dxc](https://forums.suse.com/u/strahil-nikolov-dxc)\
**Post date:** [September 23, 2019, 5:03pm UTC](https://forums.suse.com/t/change-cron-log-level/34256/7 "2019-09-23T17:03:49Z")

</div>

I don’t know which Linux does - at least RHEL and SLES don’t.

Another approach is to make each job as a systemd service file ‘Exec=/my/script’ ,Configure logging properly ‘journal,console, syslog,etc’ and then use systemd’ s timers.  
That way you can have your jobs properly logging anything you need. You can have debug enabled in your script ‘set -x’ or #!/bin/bash -x’ and you will see any detail in the journal/syslog files.

Don’t forget that Linux is opensource and you can modify it as you wish and even propose features to vendors like Canonical, Red Hat or SuSE (which is not possible with HP-UX)

---

<div class="post-metadata">

**Author:** ![gu\_adamski](https://avatars.discourse-cdn.com/v4/letter/g/f4b2a3/32.png) [@gu\_adamski](https://forums.suse.com/u/gu_adamski)\
**Post date:** [September 25, 2019, 9:31pm UTC](https://forums.suse.com/t/change-cron-log-level/34256/8 "2019-09-25T21:31:56Z")

</div>

thanks, not sure what we will do. hard to change when for 20+ years you been doing things one way then your ERP says they’re changes supported OS’s and you have months to switch. Makes for some grumpy people. Linux maybe open source, but the contract with ERP providers says we can’t make changes from standard release, or they will not support us. (and will still have to pay for support whether we get it or not - isn’t that nice of them).

we will get use to Suse at some point.

john

---

<div class="post-metadata">

**Author:** ![strahil-nikolov-dxc](https://avatars.discourse-cdn.com/v4/letter/s/58956e/32.png) [@strahil-nikolov-dxc](https://forums.suse.com/u/strahil-nikolov-dxc)\
**Post date:** [September 26, 2019, 7:51am UTC](https://forums.suse.com/t/change-cron-log-level/34256/9 "2019-09-26T07:51:59Z")

</div>

Creation of systemd services to replace existing cron jobs must be supported . After all systemd is the new init - if your systemd.timer is not working properly SUSE will provide support when needed.
