Why is the "date" command part of zfsutils-linux.cron.d ?

Asked by mpb

On my 18.04 Ubuntu system, the file /etc/cron.d/zfsutils-linux comes from the zfsutils-linux package. This package is built by zfs-linux_0.7.12-1ubuntu5.dsc.

The file /etc/cron.d/zfsutils-linux includes the following lines:

# Scrub the second Sunday of every month.
24 0 8-14 * * root [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ] && /usr/lib/zfs-linux/scrub

My question is, why the above instead of:

24 0 8-14 * Sun root [ -x /usr/lib/zfs-linux/scrub ] && /usr/lib/zfs-linux/scrub

I suspect both variants are functionally equivalent. I find the second variant is easier to read.

Thank you.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu zfs-linux Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Ubuntu has inherited this file in the package from Debian. Maybe you should better ask there.
https://salsa.debian.org/zfsonlinux-team/zfs/blob/master/debian/zfsutils-linux.cron.d

Can you help with this problem?

Provide an answer of your own, or ask mpb for more information if necessary.

To post a message you must log in.