Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File creation w/ date stamp

Status
Not open for further replies.

jseva

IS-IT--Management
Mar 26, 2001
26
US
How can I dynamically create a file that includes the date in the filename?

I am using the /var/adm/wtmp file to track all login sessions for the day. Using cron, I want the system to copy this wtmp file to a new file with the date (and time) in the filename.

Please advise.
 
try cp /var/adm/wtmp /log.archive/wtmp.$(date +%b%d%Y)

Tony ... aka chgwhat

When in doubt,,, Power out...
 
You 'da man, Tony! Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top