neither "backintime -b" nor "backintime --backup-job" work when run by cron
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Back In Time |
Confirmed
|
High
|
Unassigned |
Bug Description
I use cron to run "backintime -b" (I also tried "backintime --backup-job" but the problem is the same) as a normal user who has write access to the snapshots path. In most cases the backup doesn't work. The systray icon says "Compare with snapshot ..." and the output of backintime 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.
INFO: Lock
INFO: Include folders: ['/home/christian']
INFO: Ignore folders: []
INFO: Last snapshots: {}
INFO: [KDE4Plugin.
INFO: Compare with old snapshot: 20091014-113755
Traceback (most recent call last):
File "/usr/share/
start_app()
File "/usr/share/
take_snapshot( cfg, True )
File "/usr/share/
snapshots.
File "/usr/share/
ret_val = self._take_
File "/usr/share/
try_cmd = self._execute_
File "/usr/share/
line = pipe.readline()
IOError: [Errno 4] Interrupted system call
----------
There remain 2 processes running forever:
1000 20714 0.0 0.0 11520 1312 ? S 15:00 0:00 /bin/sh /usr/bin/backintime -b
1000 20718 0.1 1.6 349204 33332 ? Sl 15:00 0:03 python /usr/share/
When I run backintime -b manually, it does work (at least I had no case where the same error occured until now).
I have Python 2.6.3 installed.
Changed in backintime: | |
status: | New → Confirmed |
importance: | Undecided → High |
I found the problem: my crond runs scripts with /bin/sh. But the external commands backintime uses do not work with sh.
Now I run a two-lined script backup and it works:
----------
#!/bin/bash
export SHELL=/bin/bash
/usr/bin/backintime -b
----------
I think this problem can be fixed by internally overwriting $SHELL or even ignoring it and running the commands directly using bash.