I’m trying to tar a two files into one, so I have this:
tar -zcvfW "${DATADIR}daily_data_files/LeveL_EOD_VOL_${1}.tar.gz" -C "${DATADIR}temp/LeveL_EOD_VOL_*_${1}.csv" >> "${DATADIR}temp/email.log"
However, I’m getting these errors:
tar: Removing leading '/' from member names
tar: /var/www/vhosts/levelats/data/daily_data_files/LeveL_EOD_VOL_20110121.tar.gz: Cannot stat: No such file or directory
tar: LeveL_EOD_VOL_*_20110121.csv: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors
I’m not sure why the tar isn’t getting created, is it because it can’t find the two Level_EOD files? Is the wildcard(*) wrong?
I think what is happening is that the
-Coption is trying to change directory into the first directory expanded by your glob pattern; I think you want:Note that I split the
-Coption from the list of CSV files that comes after it.