(Elementary user)
I have some log files that are named like this:
logfile_August 2010.txt
logfile_September 2010.txt
logfile_October 2010.txt
I would like to write a small script that would copy the current log (i.e. the month we are in) to another location.
Can I use the date and year flag to do this?
Here is my script in layman's terms:
cp -p /source/logfile_date(%B %Y).txt /target/current_logfile.txt
Alternatively, is there a copy flag that will select the logfile with the 'youngest' creation date?
Best regards
I have some log files that are named like this:
logfile_August 2010.txt
logfile_September 2010.txt
logfile_October 2010.txt
I would like to write a small script that would copy the current log (i.e. the month we are in) to another location.
Can I use the date and year flag to do this?
Here is my script in layman's terms:
cp -p /source/logfile_date(%B %Y).txt /target/current_logfile.txt
Alternatively, is there a copy flag that will select the logfile with the 'youngest' creation date?
Best regards