1

[SOLVED] Bash script behaving differently in crontab vs manually run

view story
linux-howto

http://ubuntuforums.org – Greetings. I have a script that purges files from a folder and I would like a record (log file) of what files were purged. I wrote the following snippet and it works when executing it from the command line: Code: LOGFILE="/path/to/logfiles/purge-folder.log" echo "`date +%Y-%m-%d_%H:%M:%S` - Script started." >> ${LOGFILE} for file in "/path/to/folder/*.txt" do   echo " - INFO: Deleting ${file}" >> ${LOGFILE}   rm ${file} done echo "`date +%Y-%m-%d_%H:%M:%S` - Script completed." >> ${LOGFILE} When I run it fro (Hardware)