Hi.
I have a cron job that downloads some information from the net @ 02:20 every weekday and stores this on the machine as XXYY.dat, where XXYY is the date in in the format MMDD.
As part of a separate process, much later, I need to copy this file and name it as follows:
XXYY.dat.YYYYMMDD-hhmm
XXYY - original name
YYYY - year (ie. 2001)
MM - month (12)
DD - date (18)
hh - hour (15)
mm - minute (03)
I have tried the following:
/bin/cp -v /download/????.dat /backup/????.dat.`date +%Y%m%d-%H%m`
But this results in a filename with ?'s...
If someone can correct my script, or point me in the direction of some instructions on getting this to work, it would be very much appreciated. AV
tnedor@yahoo.com
Did this post help? Click below to let me know.
I have a cron job that downloads some information from the net @ 02:20 every weekday and stores this on the machine as XXYY.dat, where XXYY is the date in in the format MMDD.
As part of a separate process, much later, I need to copy this file and name it as follows:
XXYY.dat.YYYYMMDD-hhmm
XXYY - original name
YYYY - year (ie. 2001)
MM - month (12)
DD - date (18)
hh - hour (15)
mm - minute (03)
I have tried the following:
/bin/cp -v /download/????.dat /backup/????.dat.`date +%Y%m%d-%H%m`
But this results in a filename with ?'s...
If someone can correct my script, or point me in the direction of some instructions on getting this to work, it would be very much appreciated. AV
tnedor@yahoo.com
Did this post help? Click below to let me know.