How to use date command in cron job ?
Issue
- How can I use 'date' command in cron job
# crontab -e
30 12 * * * /usr/bin/tar -cpzf /Backup/EAP_backup/$(date '+%Y-%m-%d').tar.gz /Directory/to/backup/
Environment
- Red Hat Enterprise Linux (All versions)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.