scripting issue
Hi i have written this simple script
#!/bin/bash cd /var/log/squid destination=/media/backup/store YMD="`date +%d%b%y`" for file in s*.gz do echo $file echo -e "renamed file $file to $file$YMD " >> ~/squid_script/log mv $file $destination/$file$YMD echo -e "file $file$YMD transfered to /media/backup/store/ \n" >> ~/squid_script/log done echo "------------------------------------------------" >> ~/squid_script/log when i execute it i get the following error cannot move `store.log.1.gz' to `/media/backup/store/store.log.1.gz25Apr10': No such file or directory can someone rectify this problem for me |
My first guess is that /media/backup either isn't mounted, or
that the directory /media/backup/store doesn't exist. Cheers, Tink |
Hi,
Did you create the directory /media/backup/store/ and has the user as who you run the script have permissions on it? Kind regards, Eric EDIT: Tinkster beat me to it! |
the directory exist and it has full permission
so i dotn think thats the issue. |
Hello,
You could set the following in your script before the executing commands: Code:
set -x Kind regards, Eric |
thanx a lot problem solved
|
It may help somebody with a similar problem if you shared the solution.
Threads can be marked SOLVED via the Thread Tools menu. |
All times are GMT -5. The time now is 11:54 AM. |