I am trying to create a tar ball in a shell script (I have enabled set -x), but I get the following 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 errortar: Error is not recoverable: exiting now...The script is:NOW=$(date +%Y-%m-%d-%T)# TARcd $HOME/public_htmlTAR_DUMP=gypo_$NOW.tar.gzecho Tar name: $TAR_DUMPtar -cvzf $TAR_DUMP gypo# mv -t $DEST $TAR_DUMPWhy is tar generating this error and how can I solve it? 
tar command generates error in shell script
shell script;filenames;tar
The : in the filename are confusing  tar. At least for the coreutils version of tar, the --file switch can take an argument of the form:hostname:/remote/file/nameso I'm guessing tar is trying to interpret that filename in a manner that is not what you meant.Prefixing the file name with ./ (or specifying a full path) should solve your problem.TAR_DUMP=./gypo_$NOW.tar.gzecho Tar name: $TAR_DUMPtar -cvzf $TAR_DUMP gypoAnother fix would be to add the --force-local switch.--force-localForces `tar' to interpret the filename given to --file as a local       file, even if it looks like a remote tape drive name.