Fcrontab reports errors

IPfire 183. fcrontab v 3.2.1

DANGEROUS! Do not try at production system, you could badly corrupt it!!

  1. login as root to IPfire console
  2. backup crontab: fcrontab -l > /root/root.crontab
  3. remove crontab (DANGER!!) fcrontab -r
  4. copy backup of crontab to new file: cp /root/root.crontab test.crontab
  5. set permissions to 600: chmod 600 test.crontab
  6. set ownership to root:cron: chown root:cron test.crontab
  7. try to load test.crontab: fcrontab -c test.crontab

I see many errors, it looks like fcrontab doesn’t like the file that was created with command fcrontab -l:

[root@vmfire ~]# fcrontab -c test.crontab 
2024-03-04 17:53:12 ERROR Unknown var name at line SHELL=/bin/bash : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line PATH=/sbin:/bin:/usr/sbin:/usr/bin : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line MAILTO= : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line HOME=/ : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line */1 * * * *	test -x /usr/local/bin/run-parts && /usr/local/bin/run-parts /etc/fcron.minutely : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line */5 * * * *	test -x /usr/local/bin/run-parts && /usr/local/bin/run-parts /etc/fcron.cyclic : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line 01 * * * *	test -x /usr/local/bin/run-parts && /usr/local/bin/run-parts /etc/fcron.hourly : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line &nice(10),bootrun 25 1 * * *	test -x /usr/local/bin/run-parts && /usr/local/bin/run-parts /etc/fcron.daily : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line &nice(10),bootrun 47 2 * * 1	test -x /usr/local/bin/run-parts && /usr/local/bin/run-parts /etc/fcron.weekly : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line &nice(10),bootrun 52 3 1 * *	test -x /usr/local/bin/run-parts && /usr/local/bin/run-parts /etc/fcron.monthly : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line 01 * * * *	/usr/sbin/logrotate /etc/logrotate.conf : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line */5 * * * *	/usr/local/bin/timecheck > /dev/null 2>&1 : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line */5 * * * * 	/usr/local/bin/makegraphs >/dev/null : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %nightly,random * 23-4	/etc/init.d/collectd backup &>/dev/null : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %nightly,random * 23-4	/etc/init.d/vnstat backup &>/dev/null : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line */5 * * * *	[ -f "/var/ipfire/red/active" ] && /usr/bin/ddns update-all : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line 05 0 * * *	/usr/local/bin/logwatch > /var/log/logwatch/`date -I -d yesterday`; \ : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line 		LOGWATCH_KEEP=$(sed -ne 's/^LOGWATCH_KEEP=\([0-9]\+\)$/\1/p' /var/ipfire/logging/settings); \ : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line 		find /var/log/logwatch/ -ctime +${LOGWATCH_KEEP=56} -exec rm -f '{}' ';' : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line 2,32 * * * * 	/usr/local/bin/hddshutdown >/dev/null : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line */5 * * * *	/usr/local/bin/connscheduler timer > /dev/null : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %nightly * 3-5   /var/ipfire/urlfilter/autoupdate/cron.daily : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %weekly  * 3-5   /var/ipfire/urlfilter/autoupdate/cron.weekly : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %monthly * 3-5 * /var/ipfire/urlfilter/autoupdate/cron.monthly : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %nightly * 3-5   /var/ipfire/updatexlrator/autocheck/cron.daily : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %weekly  * 3-5   /var/ipfire/updatexlrator/autocheck/cron.weekly : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %monthly * 3-5 * /var/ipfire/updatexlrator/autocheck/cron.monthly : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %nightly,random * 23-4	/usr/bin/sendprofile >/dev/null 2>&1 : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %nightly,random * 23-4	/usr/local/bin/pakfire update >/dev/null 2>&1 : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line 00 3 * 3 0          /usr/local/bin/timezone-transition /usr/local/bin/firewallctrl : line ignored
2024-03-04 17:53:12 ERROR Unknown var name at line 00 2 * 10-11 0      /usr/local/bin/timezone-transition /usr/local/bin/firewallctrl : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %hourly,random * [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-location-database >/dev/null 2>&1 : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line @ 12h [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-ids-ruleset >/dev/null 2>&1 : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line @ 15 [ -f "/var/ipfire/red/active" ] && /usr/local/bin/update-ipblocklists >/dev/null 2>&1 : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %hourly * /usr/sbin/dma -q : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %hourly * /usr/bin/captive-cleanup : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %nightly * 23-1   /usr/local/bin/captivectrl >/dev/null : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %weekly * * /usr/sbin/dma-cleanup-spool : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %weekly * * /bin/find /var/log/rrd -mtime +365 -type f -name '*.rrd' -delete -o -type d -empty -delete : line ignored
2024-03-04 17:53:12 ERROR Zero-length var name at line %daily,random * * @runas(nobody) /usr/sbin/unbound-anchor -a /var/lib/unbound/root.key -c /etc/unbound/icannbundle.pem : line ignored
fcrontab [-n] file [user|-u user]
fcrontab { -l | -r | -e | -z } [-n] [user|-u user]
fcrontab -h
  -u user    specify user name.
  -l         list user's current fcrontab.
  -r         remove user's current fcrontab.
  -e         edit user's current fcrontab.
  -z         reinstall user's fcrontab from source code.
  -n         ignore previous version of file.
  -c f       make fcrontab use config file f.
  -d         set up debug mode.
  -h         display this help message.
  -V         display version & infos about fcrontab.

documantation for fcrontab

IMPORTANT UPDATE: Command fcrontab -c file reads configuration file. that is why it doesn’t like backup file and reports errors. There is no easy way to restore crontab from backup file. Run fcrontab -e and editor will be started, type/paste old crontab to the editor and save it…