1

Back In Time is set up to start backups daily as soon as the external disk got connected. This results in a udev rule which starts anacron with a config file generated by Back In Time. Unfortunately the backups do not run, as anacron always throws an error anacron: Can't open timestamp file for job 1_Main_profile: Read-only file system (seen in syslog). The command which Back In Time generated as udev rule runs fine, if started manually (started as root user and as the ordinary user jdoe). (Also the backup runs fine when started manually via GUI.)

I would be happy to find at least out which file exactly anacron can not open, and of course why.

udev rule:

ACTION=="add", ENV{ID_FS_UUID}=="dd68d7f7-054b-dae0-a4a2-4315acad138a", RUN+="/bin/su - 'jdoe' -c 'test -x /usr/sbin/anacron && test -e /home/jdoe/.config/backintime/anacrontab-dd68d7f7-054b-dae0-a4a2-4315acad138a && /usr/sbin/anacron -s -t /home/jdoe/.config/backintime/anacrontab-dd68d7f7-054b-dae0-a4a2-4315acad138a -S /home/jdoe/.local/share/backintime/anacron' &"

anacrontab, modified for now to do just logging, original file (without logger "… " ||) did start backup fine when executed manually, but not automatically:

$ cat /home/jdoe/.config/backintime/anacrontab-dd68d7f7-dae0-4315-a4a2-054bacad138a
SHELL=/bin/bash
PATH=/home/jdoe/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
DISPLAY=:0.0
1   0   1_Main_profile  /usr/bin/logger "would start backup now, but exiting, as you set in anacrontab :-)" || /usr/bin/nice -n 19 /usr/bin/ionice -c2 -n7 /usr/bin/backintime --backup-job >/dev/null 2>&1

files/folders (rights of '1_Main_profile' get set like this by running anacron command out of udev rule):

$ ls -ld /home/jdoe/.local/share/backintime/anacron/
drwxrwxrwx 2 jdoe jdoe 4096 Jul 18 10:41 /home/jdoe/.local/share/backintime/anacron/
$ ls -l /home/jdoe/.local/share/backintime/anacron/
insgesamt 8
-rw------- 1 jdoe jdoe 9 Jul 18 10:42 1_Main_profile
$ groups jdoe
jdoe : jdoe adm cdrom sudo dip plugdev lpadmin sambashare vboxusers
$ ls -ld /var/spool/anacron/
drwxrwxr-x 2 root adm 4096 Apr 30  2016 /var/spool/anacron/
$ ls -l /var/spool/anacron/
insgesamt 12
-rw------- 1 root root 9 Jul 18 10:20 cron.daily
-rw------- 1 root root 9 Jun 29 09:07 cron.monthly
-rw------- 1 root root 9 Jul 18 10:24 cron.weekly

Starting command out of udev rule manually (as root via ssh, starting it without the "logger "…" || from above will start backup):

$ /bin/su - 'jdoe' -c 'strace /usr/sbin/anacron -s -t /home/jdoe/.config/backintime/anacrontab-dd68d7f7-054b-dae0-a4a2-4315acad138a -S /home/jdoe/.local/share/backintime/anacron &> /dev/shm/strace-anacron-backintime'
X11 connection rejected because of wrong authentication.

$ cat /dev/shm/strace-anacron-backintime
execve("/usr/sbin/anacron", ["/usr/sbin/anacron", "-s", "-t", "/home/jdoe/.config/backintime/"..., "-S", "/home/jdoe/.local/share/backin"...], [/* 26 vars */]) = 0
brk(NULL)                               = 0x562556b3c000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f75287a6000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=178056, ...}) = 0
mmap(NULL, 178056, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f752877a000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\3\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1685264, ...}) = 0
mmap(NULL, 3791264, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f75281e8000
mprotect(0x7f752837d000, 2093056, PROT_NONE) = 0
mmap(0x7f752857c000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x194000) = 0x7f752857c000
mmap(0x7f7528582000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f7528582000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f7528778000
arch_prctl(ARCH_SET_FS, 0x7f7528778700) = 0
mprotect(0x7f752857c000, 16384, PROT_READ) = 0
mprotect(0x5625560cc000, 4096, PROT_READ) = 0
mprotect(0x7f75287a9000, 4096, PROT_READ) = 0
munmap(0x7f752877a000, 178056)          = 0
brk(NULL)                               = 0x562556b3c000
brk(0x562556b5d000)                     = 0x562556b5d000
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3259968, ...}) = 0
mmap(NULL, 3259968, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f7527ecc000
close(3)                                = 0
open("./", O_RDONLY)                    = 3
chdir("/home/jdoe/.local/share/backintime/anacron") = 0
umask(000)                              = 022
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
close(0)                                = 0
open("/dev/null", O_RDONLY)             = 0
close(1)                                = 0
open("/dev/null", O_WRONLY)             = 1
close(2)                                = 0
open("/dev/null", O_WRONLY)             = 2
clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f75287789d0) = 4473
exit_group(0)                           = ?
+++ exited with 0 +++

1 Answer 1

1

The timestamp file in question is /home/jdoe/.local/share/backintime/anacron/1_Main_profile. Please make sure it is writeable. You're also save to remove it. Anacron will write a new one next time.

But I also recommend updating to a more recent BiT version (current stable is 1.1.20). I replaced anacron dependency a while ago with pure Python code which made that schedule more reliable.

2
  • 1
    I also thought this would be the file in question. But even when making it world writable by hand, it did not work in automatic mode. And running the su… manually did work with the rights one can see above. (Hoping that 1.1.20 is coming soon to Stretch/Zesty/Sonya/whatever, thx for that, currently it's only 1.1.12 everywhere besides the project's repo)
    – Jaleks
    Commented Jul 18, 2017 at 21:15
  • Unfortunately the Debian package does not get updated on a regular basis. Just install from my PPA ppa:bit-team/stable or download the release tarball from github and build it manually with makedeb.sh script inside
    – Germar
    Commented Jul 19, 2017 at 16:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .