Closed paolodemo closed 7 years ago
It seems that bups cannot find the bup
command. Can you check it is in your PATH
?
bup is in the PATH.
I added modify the PATH making the source of a file containing:
export PATH="/additional/bin/bin:/additional/sources/bups/bin:$PATH"
then:
$ which bup
/additional/bin/bin/bup
I solved adding the environment variable BUP_MAIN_EXE pointing to the bup executable.
I'm not a python developer but maybe the env variable into Popen (worker.py row 112) can overwrite the environment PATH.
Okay, the problem here is that BUP_MAIN_EXE
is set automatically to bup
when not defined (https://github.com/emersion/bups/blob/master/bups/worker.py#L39), and you have a custom bup install dir. Not sure how to fix that, maybe we could search bup
in the PATH
instead?
I suggested the problem can be the env because I setup this simple test:
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from subprocess import PIPE, Popen, call
>>> Popen("bup")
<subprocess.Popen object at 0x7f5f4721d210>
>>> Usage: bup [-?|--help] [-d BUP_DIR] [--debug] [--profile] <command> [options...]
Common commands:
fsck Check backup sets for damage and add redundancy information
ftp Browse backup sets using an ftp-like client
fuse Mount your backup sets as a filesystem
help Print detailed help for the given command
index Create or display the index of files to back up
on Backup a remote machine to the local one
restore Extract files from a backup set
save Save files into a backup set (note: run "bup index" first)
tag Tag commits for easier access
web Launch a web server to examine backup sets
Other available commands:
bloom drecurse import-rsnapshot ls midx prune-older split
cat-file gc init margin mux random tick
daemon import-duplicity join memtest newliner rm version
damage import-rdiff-backup list-idx meta on--server server xstat
See 'bup help COMMAND' for more information on a specific command.
>>> Popen("bup",env={})
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
>>> import os
>>> env={}
>>> env['PATH'] = os.environ['PATH']
>>> Popen("bup",env=env)
<subprocess.Popen object at 0x7f5f4721d6d0>
>>> Usage: bup [-?|--help] [-d BUP_DIR] [--debug] [--profile] <command> [options...]
Common commands:
fsck Check backup sets for damage and add redundancy information
ftp Browse backup sets using an ftp-like client
fuse Mount your backup sets as a filesystem
help Print detailed help for the given command
index Create or display the index of files to back up
on Backup a remote machine to the local one
restore Extract files from a backup set
save Save files into a backup set (note: run "bup index" first)
tag Tag commits for easier access
web Launch a web server to examine backup sets
Other available commands:
bloom drecurse import-rsnapshot ls midx prune-older split
cat-file gc init margin mux random tick
daemon import-duplicity join memtest newliner rm version
damage import-rdiff-backup list-idx meta on--server server xstat
See 'bup help COMMAND' for more information on a specific command.
Popen doesn't fail to find bup in the PATH if called with one argument. Popen fails when empty env is passed, so I think the PATH data is loss. Popen doesn't fail if PATH is into env.
Can you confirm the latest commit fixes the issue?
Yes, it's fixed. Many thanks
I setup bups on linux ubuntu, and it was working great. Then I switched to linux mint and when I restarted the backup I obtain this error
I have no idea what can be changed. I'm currently using both bups and bup not from the repositories but from git. Can you help me solving the problem?
Thank you for your great job!