Unknown user-context after update to bit 1.06

Asked by Alex K

Hi everyone,

and thanks to the team for your work on this very useful program.

I used backintime 0.9.26 and had scheduled backups with anacron, everything worked fine.
Then i updated to backintime 1.0.6, so i had to change my script "1backintime" in the cron.daily-folder from

#!/bin/bash
backintime -b > /dev/null 2>&1

to

#!/bin/bash
backintime --profile "Main profile" --profile-id "1" -b > /dev/null 2>&1

Starting backintime in a root-shell with this new syntax works fine.
But the scheduled backups fail, syslog says:

Mar 22 21:11:04 alex-ubuntu anacron[1015]: Job `cron.daily' started
Mar 22 21:11:04 alex-ubuntu anacron[1699]: Updated timestamp for job `cron.daily' to 2011-03-22
Mar 22 21:11:05 alex-ubuntu backintime (unknown): INFO: Lock
Mar 22 21:11:05 alex-ubuntu backintime (unknown): INFO: on process begins
Mar 22 21:11:05 alex-ubuntu backintime (unknown): INFO: [GnomePlugin.Systray.run]
Mar 22 21:11:05 alex-ubuntu backintime (unknown): INFO: [GnomePlugin.Systray.run] begin loop
Mar 22 21:11:05 alex-ubuntu backintime (unknown): INFO: Profile_id: 1
Mar 22 21:11:35 alex-ubuntu backintime (unknown): WARNING: Can't find snapshots folder !
Mar 22 21:11:37 alex-ubuntu backintime (unknown): INFO: [GnomePlugin.Systray.run] end loop
Mar 22 21:11:37 alex-ubuntu backintime (unknown): INFO: Unlock

So why is the user-context now unknown instead of root?

Question information

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

Please try only with the id:

backintime --profile-id 1 -b > /dev/null 2>&1

Regards,
Dan

Revision history for this message
Alex K (alexkremer) said :
#2

I have changed the syntax as recommended,
but the error-message is still the same:

Mar 27 22:47:01 alex-ubuntu backintime (unknown): INFO: Profile_id: 1
Mar 27 22:47:31 alex-ubuntu backintime (unknown): WARNING: Can't find snapshots folder !

As mentioned before, the problem exists only in combination with anacron.
Backintime works when i start it manually via root-shell.

Revision history for this message
Best Dan (danleweb) said :
#3

I think when it runs from anacron it run as user "unknown" and not as your regular user.
You should try to run the command using "su" (check "man su" for more informations).

Regards,
Dan

Revision history for this message
Alex K (alexkremer) said :
#4

Thanks Dan,
you gave me the right hint.

The problem was obviously, that in Ubuntu 10.04 the root-Account is deactivated by default.
Backintime 0.9.26 with it's old snapshot-version doesn't take notice of that, backintime >= 1.0 does.

So changing my anacron script to

su -c "backintime --profile-id 1 -b > /dev/null 2>&1"
or
sudo -H backintime --profile-id 1 -b > /dev/null 2>&1

is the solution.

Thanks again,
Alex.

Revision history for this message
Alex K (alexkremer) said :
#5

Thanks Dan, that solved my question.

Revision history for this message
Franz Hartwig (franz-hartwig) said :
#6

Hi all,

I configured my Back in Time to run with anacron. I use Back in Time 1.0.7. My anacron script was according to this thread

sudo -H "backintime - b > /dev/null 2>&1"

Unfortunately, this did not work. I changed the script to the pre 1.0 version:

backintime -b > /dev/null 2>&1

This works fine, now!

So perhaps the adapted script is only valid for Back in Time version 1.0 to 1.0.6?

Best regards,

Franz

Revision history for this message
Dan (danleweb) said :
#7

Strange, there should be no difference.
Can you try the first script but redirect the output to a file (not /dev/null) so you can get more informations.

Revision history for this message
Franz Hartwig (franz-hartwig) said :
#8

Here's the anacron output:

/etc/cron.daily/1backintime:
sudo: backintime - b > /home/franz/backintime.txt 2>&1: command not found
run-parts: /etc/cron.daily/1backintime exited with return code 1

Peter

Revision history for this message
Dan (danleweb) said :
#9

It looks like it does not find "backintime" command.
This should be in "/usr/bin/" (like rsync).
Can you create a script that just print the path to a file (ex: "echo $PATH >> /home/franz/abc.txt") and run it from anacron ?

Revision history for this message
Franz Hartwig (franz-hartwig) said :
#10

Yes, backintime is in /usr/bin. The anacrontab includes this path (among others, I did not edit the anacrontab).

With backintime -b > /dev/null 2>&1 instead of sudo -H "backintime - b > /dev/null 2>&1" in the script, it works. So there is no reason not to find the command ...

This evening I will create the script, tomorrow in the morning I will start my computer and post the output.

Revision history for this message
Franz Hartwig (franz-hartwig) said :
#11

The script is now:

#!/bin/bash
#set -x
export HOME=/root
sudo -H "backintime - b > /home/franz/backintime.txt 2>&1"

no action, no mail, no file named backintime.txt

Revision history for this message
Franz Hartwig (franz-hartwig) said :
#12

Actually, the script /etc/cron.daily/1backintime is:

#!/bin/bash
export HOME=/root
backintime -b > /home/franz/backintime.txt 2>&1

This morning, the snapshot was taken. The file /home/franz/backintime.txt is:

Back In Time
Version: 1.0.7

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.

INFO: Lock
INFO: on process begins
INFO: Profile_id: 1
INFO: Compare with old snapshot: 20120322-181951-627
INFO: Command "rsync -rtDH --links -A -pEgo --delete --delete-excluded -i --dry-run --out-format="BACKINTIME: %i %n%L" --chmod=Du+wx --exclude="/media/Backup_HD" --exclude="/root/.local/share/backintime" --include="/home/franz/" --include="/home/" --exclude=".gvfs" --exclude=".cache*" --exclude="[Cc]ache*" --exclude=".thumbnails*" --exclude="[Tt]rash*" --exclude="*.backup*" --exclude="*~" --exclude="/root/Ubuntu One" --exclude=".dropbox*" --exclude="/home/franz/Ubuntu One" --exclude="*[Tt]emp*" --include="/home/franz/**" --exclude="*" / "/media/Backup_HD/backintime/HP-Ubuntu/franz/1/20120322-181951-627/backup/"" returns 0
INFO: Create hard-links
INFO: Command "find "/media/Backup_HD/backintime/HP-Ubuntu/franz/1/20120322-181951-627/backup/" -type d -exec chmod u+wx {} \;" returns 0
INFO: Command "cp -aRl "/media/Backup_HD/backintime/HP-Ubuntu/franz/1/20120322-181951-627/backup/"* "/media/Backup_HD/backintime/HP-Ubuntu/franz/1/new_snapshot/backup/"" returns 0
INFO: Command "find "/media/Backup_HD/backintime/HP-Ubuntu/franz/1/20120322-181951-627/backup/" -type d -exec chmod a-w {} \;" returns 0
INFO: Command "chmod -R a+w "/media/Backup_HD/backintime/HP-Ubuntu/franz/1/new_snapshot"" returns 0
INFO: Call rsync to take the snapshot
INFO: Command "rsync -rtDH --links -A -pEgo --delete --delete-excluded -v --chmod=Du+wx --exclude="/media/Backup_HD" --exclude="/root/.local/share/backintime" --include="/home/franz/" --include="/home/" --exclude=".gvfs" --exclude=".cache*" --exclude="[Cc]ache*" --exclude=".thumbnails*" --exclude="[Tt]rash*" --exclude="*.backup*" --exclude="*~" --exclude="/root/Ubuntu One" --exclude=".dropbox*" --exclude="/home/franz/Ubuntu One" --exclude="*[Tt]emp*" --include="/home/franz/**" --exclude="*" / "/media/Backup_HD/backintime/HP-Ubuntu/franz/1/new_snapshot/backup/" 2>&1" returns 0
INFO: Save config file
INFO: Command "cp /root/.config/backintime/config /media/Backup_HD/backintime/HP-Ubuntu/franz/1/new_snapshot/backup/.." returns 0
INFO: Save permissions
INFO: Create info file
INFO: Command "chmod -R a-w "/media/Backup_HD/backintime/HP-Ubuntu/franz/1/20120324-075535-439/backup"" returns 0
INFO: Command "chmod -R a-w "/media/Backup_HD/backintime/HP-Ubuntu/franz/1/20120322-181951-627/backup/"" returns 0
INFO: Remove backups older than: 20020324-000000
INFO: Keep min free disk space: 1024 Mb
INFO: Unlock

Revision history for this message
Dan (danleweb) said :
#13

It looks OK for me.
Is it correct ?

Revision history for this message
Franz Hartwig (franz-hartwig) said :
#14

Yes, it's o.k. But you should know that the above mentioned anacron script for Back In Time 1.0 and greater does not work with version 1.0.7. You should know that the old script for Back In Time <1.0 works with Version 1.0.7.