Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Time/date stamping files
Name: smiller43147 Date: November 6, 2006 at 13:54:00 Pacific OS: HP-UX CPU/Ram: PA-RISC Product: HP rp7400
Comment:
Can create files w/ Time/date stamps from the shell (touch file_`date +%Y%m%d`) but this does not work when the same command is entered in the crontab.
Name: nails Date: November 6, 2006 at 17:40:22 Pacific
Reply:
Typically, when commands/scripts don't work work from the shell and not from cron, it is because the cron environment isn't the same. Generally, it's because cron's PATH is different from your user's PATH.
Also, keep in mind that cron uses the bourne shell as it's default. That's why you are better off placing your touch command in a script like this:
Summary: Hi, I'm a newbie to scripting in Unix and I need help with the following. I want to write a script that would retrieve the creation date/time of a file and compare that to the current date/time to det...
Summary: I sometimes use dates in file naming, but I prefer sequential numbering since that is unique, and I still have the date stamp of the file to show me when it was created. When using dates, consider inc...
Summary: I am needing to set up a chron job on a Solaris machine that runs at midnight local time, stores collected data, & clears counters It needs to collect the output of sho atm counters and send that data...