I am trying to create a tar ball in a shell script (I have enabled set -x
), but I get an error:
+ cd /home5/mysite/public_html
+ TAR_DUMP=gypo_2012-02-18-03:51:15.tar.gz
+ echo 'Tar name: gypo_2012-02-18-03:51:15.tar.gz'
Tar name: gypo_2012-02-18-03:51:15.tar.gz
+ tar -cvzf gypo_2012-02-18-03:51:15.tar.gz gypo
...
tar: gypo_2012-02-18-03\:44\:04.tar.gz: Cannot open: Input/output error
tar: Error is not recoverable: exiting now
...
The script is the following:
NOW=$(date +"%Y-%m-%d-%T")
# TAR
cd $HOME/public_html
TAR_DUMP="gypo_$NOW.tar.gz"
echo "Tar name: $TAR_DUMP"
tar -cvzf $TAR_DUMP gypo
# mv -t $DEST $TAR_DUMP
Why is tar generating this error and how can I solve it? Thanks.