Shell Script

Shell Script

Posted by: oklahomlandrun
Posted on: 2008-10-03 11:00:00

I've seen other similar problems on these posts. This problem seems to be different. None of the information from the other posts has helped me fix the problem. Any help would be appreciated.

ERROR MSG;
tar: davidrayshaw.com: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors

SCRIPT;
#!/bin/bash
suffix=$(date +%C%y%m%d)
domains=( "audit247.com" "davidrayshaw.com" )
cd `ls --color=never -d /home/david_shawacct/backups|head -n1`
for domain in ${domains[@]}
do
tar -cf /home/david_shawacct/backups/archives/davidrayshaw.com.$suffix.tar davidrayshaw.com/
done

BACKGROUND;
I created the file using vi on Garth through a Terminal session.



OklahomaLandRun

Re: Shell Script

Posted by: sXi
Posted on: 2008-10-03 11:47:00

You're cd'ing into the backups folder before attempting the tar.

Assuming davidrayshaw.com is in $HOME, don't cd.

If you want to tar from a different dir, ~/davidrayshaw.com is the path to the domain folder.


Re: Shell Script

Posted by: oklahomlandrun
Posted on: 2008-10-03 14:47:00

That worked.
Thanks

OklahomaLandRun

Tags: tar cfshell scripterror msgbackupssuffixstat