2

I'm running zulip on a virtual private server, and have created a script backup-zulip on my laptop (with ubuntu 20.04) to back up zulip via ssh. I want to run this script daily, so I put the line

@daily  10      backup-zulip    sudo -u username /home/username/bin/backup-zulip

into /etc/anacrontab/. However, now the backup seems to run hourly whenever the laptop is turned on, filling up my drive far too fast.

What's going on?

I wondered whether the script gets rerun each hour by anacron since it exits on error, but running it by hand returns 0.

Is there a log file that I can look into? Searching for cron in /var/log/ gives nothing.

My complete /etc/anacrontab looks as follows:

# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
HOME=/root
LOGNAME=root

# These replace cron's entries
1       5       cron.daily      run-parts --report /etc/cron.daily
7       10      cron.weekly     run-parts --report /etc/cron.weekly
@monthly        15      cron.monthly    run-parts --report /etc/cron.monthly

@daily  10      backup-zulip    sudo -u username /home/username/bin/backup-zulip

(If this is not the correct stack exchange for this question, where should I post it to?)

6
  • Does this answer help?
    – harrymc
    Nov 14 '20 at 19:45
  • Exactly same issue here! Shame there's no answers. Did you ever find out what was wrong? May 12 at 9:23
  • 1
    @PeterSnow Yes, I figured it out. Replace @daily by 1 and it works. @daily doesn't exist. the only valid non-numerical interval is @monthly, since months do not have a fixed number of days.
    – user313032
    May 12 at 14:29
  • @user313032 Oh what! That's incredible. Seems so many tutorials all got it wrong. Thanks for you help on this, I'm sure this will fix it. Gracias! May 12 at 14:42
  • @PeterSnow yes, there are blogposts out there that suggest to use @daily. Maybe it was supported in an older version.
    – user313032
    May 12 at 15:02

Browse other questions tagged or ask your own question.