User Tools

Site Tools


wiki:run_borgbackup_each_day

Run anacron in user mode

You can set up a separate anacron instance to run in user mode:

1. Create a .anacron folder in your home directory and in it two subfolders, etc and spool:

mkdir -p ~/.anacron/{etc,spool}

2. Create a new file ~/.anacron/etc/anacrontab with contents similar to the following:

# /etc/anacrontab: configuration file for anacron
 
# See anacron(8) and anacrontab(5) for details.
 
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
# this will run test.sh script once each day
# period  delay  job-identifier  command
1         10     testjob         test.sh > /tmp/test.log 2>&1

3. Add the following line to your crontab using crontab -e:

@hourly /usr/sbin/anacron -s -t $HOME/.anacron/etc/anacrontab -S $HOME/.anacron/spool

Test

anacron -fdn -t $HOME/.anacron/etc/anacrontab -S $HOME/.anacron/spool

Tested on

  • Xubuntu 20.04
  • Kde Neon 20.04

See also

References

wiki/run_borgbackup_each_day.txt · Last modified: 2023/04/12 12:17 by antisa

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki