LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   tar error.. help.. (https://www.linuxquestions.org/questions/linux-software-2/tar-error-help-164022/)

chtla 03-29-2004 11:55 PM

tar error.. help..
 
# cat last_date
2004-03-30 14:48:46

# vi back.sh
===========================================
#!/bin/bash

from_dir="/var/spool/mail"
to_dir="/home/mail/"
file=`date +%Y%m%d%H%M%S`
today=`date "+%Y-%m-%d %H:%M:%S"`
to_file=${file}.tar.gz
last_file="last_date"

if [ -f /home/mail/last_date ]
then
tar cvfz ${to_dir}${to_file} -N `cat ./last_date` ${from_dir}
else
tar cvfz ${to_dir}${to_file} ${from_dir}
fi
echo $today > ${to_dir}${last_file}
============================================

tar: 14\:48\:24: Cannot stat: not found file or directory
tar: Removing leading `/' from member names
var/spool/mail/
var/spool/mail/aaa
tar: Error exit delayed from previous errors

i don't know what problem..
Any help will be appreciated.
Thanks

Punboy 03-30-2004 04:53 AM

You need to put a \ before every space in the lastdate string.


All times are GMT -5. The time now is 04:05 AM.