Reputation: 3949
I have a script with a line:
ruby /root/backup_scripts/new_scripts/aapxen01.rb>>/volumes/backups/aapxen01/$date.log 2>&1
This produces a log file named ".log", obviously not what I'm looking for. How do I do it to produce the current date as the filename?
Upvotes: 2
Views: 6943
Reputation: 19756
Avoid backquotes and use this instead: $(date '+%Y-%m-%d')
http://mywiki.wooledge.org/BashFAQ/082
Upvotes: 3