copy to a new directory and rename w/date stamp
Hi,
Newbie 1st post here. Trying to find the most efficient way to copy a file to a different directory and rename it with a date stamp extension. Looking to accomplish this with one command if possible. File = make_file Full path /home/user1/bin/scripts/make_file would like to move to the following directory /home/user1/bin/scripts/archive/ I'm trying to find out how to use command substitution along with the date command that when I copy the file to the archive directory it gets renamed with a time stamp extension. It should look something like "make_page_12:00:00-24-10-2010" I've tried a few different combinations using the cp and mv commands but can't seem to get it to work the way I want to. Much thanks to anybody that can help getting this Windows sysadmin on the right track to learning this great OS. |
This might help:
Code:
SUFFIX=`date +%y%m%d` Quote:
'Hope that helps |
Sorry, but this is confusing me.
echo "SUFFIX: $SUFFIX, MYFILE: $MYFILE" SUFFIX: 101024, MYFILE: myfile.101024 I was looking to accomplish this by using the mv or cp commands. |
Quote:
Not sure if this is what you wanted. Hope this helps. |
All times are GMT -5. The time now is 11:45 PM. |