MattyMoose

msg:3008298 | 10:39 pm on Jul 14, 2006 (gmt 0) |
when you run this, try running it with: sh -x nameofscript.sh See what is causing the errors.
|
matthewamzn

msg:3009433 | 2:56 pm on Jul 15, 2006 (gmt 0) |
It looks like I have a lot of errors in my script. Why would this result in no file or directory found? # sh -x backupscript.sh ++ date +%Y%m%d + DATE=20060715 + cd $'/var/www/vhosts/website.com/private/\r' : No such file or directory: /var/www/vhosts/website.com/private/ + mkdir $'20060715\r-backups\r' + $'cd\r' : command not foundne 7: cd
|
matthewamzn

msg:3009747 | 7:47 pm on Jul 15, 2006 (gmt 0) |
I'm using EditPlus to create the script. Then saving it as a utf-8 file. Then uploading it in ascii mode.
|
NickCoons

msg:3010000 | 12:19 am on Jul 16, 2006 (gmt 0) |
| Why would this result in no file or directory found? |
| Because of this: + cd $'/var/www/vhosts/website.com/private/\r' : No such file or directory: |
| It's telling you that the directory you're trying to change in to doesn't exist. Since the change directory command fails, the make directory command makes the directory wherever you're running the script from.
|
bcc1234

msg:3010048 | 1:33 am on Jul 16, 2006 (gmt 0) |
\r is the problem. You wan to save it in unix format with bare LF's. Also, ${DATE}-backups is the correct way to make sure the shell knows at which character the name of the variable ends.
|
|