"No such file or directory" - error when running current script
Closed this issue · 8 comments
Hi there, I updated my copy of duplicity-backup.sh to the current version last week. Since then, duplicity has not been running - I went to check it today manually, and when I call duplicity-backup.sh (with or without parameters), I receive the error "No such file or directory". I do not know which file or directory it is referring to which is missing. I always supply the full path to the config file when I run duplicity via cron using the -c switch, I have checked the cron line and it is supplying the correct path and the file exists. However, the same error is returned whether or not -c is specified.
Could you update the script to inform the user which file or directory it is looking for which is missing?
AHA, Ben
Can you give the following additional information:
- the location of the script (absolute path)
- the location of the config file (absolute path)
- the exact line that is used in your crontab (redacting any personal information if needed)
- the full error message and where exactly did you see it (in the log file of cron, in the log file of duplicity-backup.sh, somewhere else... ?)
Given the current information, I can't really know which process is reporting the "No such file or directory" error. This error is the standard one for many parts of the system when encountering the ENOENT error from the corresponding syscall.
Thanks!
Hi there:
- the script is at
/pwpsetup/CentOSServerMgmt/duplicity/duplicity-backup-master/duplicity-backup.sh
. - the config file is at
/pwpsetup/CentOSServerMgmt/duplicity/duplicity-backup-master/config/duplicity-backup.{servername}.conf
- the cron line is
cd /pwpsetup/CentOSServerMgmt/duplicity/duplicity-backup-master; ./duplicity-backup.sh -c /pwpsetup/CentOSServerMgmt/duplicity/duplicity-backup-master/config/duplicity-backup.{servername}.conf -b
- the full error message is "No such file or directory". The cron line is not producing any output or log files at all. I am aware of the problem because I am not receiving emailed duplicity logs. I get the error in the console when I run duplicity-backup.sh with or without parameters.
When I replace duplicity-backup.sh with the version I had before I updated last week, running duplicity-backup.sh at the console produces the help information from the script as normal. Running the full cron line in the console starts the script running. If I update to the latest version, I get the error "No such file or directory".
{servername} is a placeholder for the name of the actual server the process is running on.
Thanks, Ben
Just to be 100% sure that we are looking at the same version of the script, what is the output of git log -1 --oneline
?
Hi, the script is deployed using our repo which is in mercurial. I copied and pasted the script from github into our repo.
I still need to be sure of the version of the script used.
Here are the MD5 and SHA1 hashes of the latest version (commit 19951b7 Fix issue #94), can you confirm that they match with your copied script:
$ md5sum duplicity-backup.sh
35b75d17faabe0f8c8cc52cd36b783b5 duplicity-backup.sh
$ sha1sum duplicity-backup.sh
71b1258227f1a7409f26cff8dac6919fc43e82d1 duplicity-backup.sh
Hi zertrin, I cannot generate the same hash as you. I literally copied the file data from https://github.com/zertrin/duplicity-backup/blob/master/duplicity-backup.sh and pasted it via SSH onto my server. I also pasted into a text editor and changed the line endings to Unix before re-copying and pasting onto the server, but still can't generate the same hash.
However, something in the process of doing that has sorted things, and I can now run the script!! So it seems the problem was between the copying of the file, pasting into the repo, and deploying to the servers.
Sorry to have troubled you...
Regards, Ben
Using the "raw" button on the page you just cited can help too.
If your server has access to internet you could for example do wget https://raw.githubusercontent.com/zertrin/duplicity-backup/master/duplicity-backup.sh
to quickly get the latest version without the trouble of the line endings conversion ;) If not, you can do this on your computer first then transfer to your server, this is still a better option to get the script than copy-pasting it in an editor :)
No problem!
as a side note:
$ wget -q -O - https://raw.githubusercontent.com/zertrin/duplicity-backup/master/duplicity-backup.sh | md5sum
35b75d17faabe0f8c8cc52cd36b783b5 -