I have set up a cron job and I want to save the output to a file. The filename should be based on the time the cron was executed (example: 20110317-113051.txt).
My real cron command is as follows:
lynx-dd> /Volumes/dev0/textfile.txtI want to replace
textfile by a unique time stamp.I have tried
links - dump> $ (Date) .txt but I get an error that the command is unclearThank you for your help!
Sorin
date$ (date +% Y % M% d-% H% M% S) .txt can be given a format for determining how to create this date, / code>. With this format, the output ofdate should be free from spaces, brackets, etc., which can confuse shell orlinks command.Look for documentation of document and format string for
date , which is similar to thestrftime function in the standard library.
Comments
Post a Comment