开发者

environment variables in redirectors, perfecting my log scripts

开发者 https://www.devze.com 2023-01-17 21:58 出处:网络
The following command, run either from cron or the prompt, does not make the expected log. I expect to get a log with the date as the file name. I a开发者_StackOverflowm able to do this in Windows by

The following command, run either from cron or the prompt, does not make the expected log. I expect to get a log with the date as the file name. I a开发者_StackOverflowm able to do this in Windows by using %date% and it makes the date the filename. What am I doing wrong here.

/root/backup_scripts/new_scripts/test.sh>/root/backup_scripts/new_scripts/$date.log 2>&1


/root/backup_scripts/new_scripts/test.sh > "/root/backup_scripts/new_scripts/$(date).log" 2>&1
0

精彩评论

暂无评论...
验证码 换一张
取 消