Shell Script


#1

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


#2

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.

Maximum Cash Discount on any plan with MAXCASH


#3

That worked.
Thanks

OklahomaLandRun