BIT fails to run under anacron

Asked by Alan German

BIT runs scheduled backups correctly using my "toaster" userid as per the following extract from the syslog:

Sep 6 07:30:01 Dell-XPS8300 backintime (toaster): INFO: Lock

However, jobs running under anacron using a script in cron.daily fail with a "not configured" error.

Sep 6 10:58:03 Dell-XPS8300 backintime (unknown): WARNING: Not configured

Clearly, the problem is that the user is "unknown". I have checked other postings on the site and have created a symlink using my user profile (toaster/.config/backintime/config) as root/.config/backintime/Link to config

For the record, I am using Ubuntu 10.04 LTS with Back In Time Version 0.9.26 (from the Ubuntu Software Centre).

The cron.daily script runs correctly if initiated manually in Terminal rather than automatically through anacron. A similar script in cron.daily, sending an E-mail to toaster, functions correctly when cron.daily runs automatically.

My cron.daily script is as follows:

----------------
#!/bin/bash

# Environment variables

SHELL=/usr/bin
PATH=/usr/bin:/bin:/usr/local/bin

# Run Back In Time

nice -n 19 /usr/bin/backintime --backup-job >/home/toaster/z_anacron_bit.txt
----------------

The output from the script to the /z_anacron_bit.txt log file is:

----------------
Back In Time
Version: 0.9.26

Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.

WARNING: Not configured
----------------

So, the bottom line seems to be that the system needs to run BIT as root but the profile symlink isn't making this happen. Any assistance on this issue would be very much appreciated.

Alan

Question information

Language:
English Edit question
Status:
Solved
For:
Back In Time Edit question
Assignee:
No assignee Edit question
Solved by:
Alan German
Solved:
Last query:
Last reply:
Revision history for this message
Alan German (alan-german) said :
#1

I found a post that suggested using sudo -H to run the (logged) user's home profile. This didn't work in of itself, but by scanning man sudo, I found that I could combine -H with -u toaster to run toaster's profile. My script command becomes;

sudo -u toaster -H nice -n 19 /usr/bin/backintime --backup-job >/home/toaster/z_anacron_bit.txt

and this works just fine with anacron at boot-up in the event that a scheduled backup time is missed because the machine is powered down.

Alan