You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to understand why this implementation of crontabis designed to exit zero when asking to list a crontab for a user that doesn't have a spool file. To me, it makes sense to exit non-zero in this instance. It would be great if crontab did this.
Not saying this project needs to follow suit, but cronie exits nonzero under the same conditions. Cronie is the default in CentOS and RHEL.
My particular use case is that I'm writing a shell script that backs up a user's current crontab to a file and deletes it:
if crontab -l -u www-data >/tmp/www-data.crontab.bak; then
mv -i /tmp/www-data.crontab.bak .
crontab -d -u www-data
fi
(I know could of course pipe the output to wc -l.)
The text was updated successfully, but these errors were encountered:
I'd like to understand why this implementation of
crontab
is designed to exit zero when asking to list a crontab for a user that doesn't have a spool file. To me, it makes sense to exit non-zero in this instance. It would be great ifcrontab
did this.Not saying this project needs to follow suit, but cronie exits nonzero under the same conditions. Cronie is the default in CentOS and RHEL.
My particular use case is that I'm writing a shell script that backs up a user's current crontab to a file and deletes it:
(I know could of course pipe the output to
wc -l
.)The text was updated successfully, but these errors were encountered: