Bash log file with date as part of name

April 11, 2012 at 16:30:35
Specs: Ubuntu 11, 21.66 GHz / 1024 MB
I am using bash as a means to log output of a python script, and I have the following:

NOW=$(date +'%b-%d-%y') && LOGFILE='conversation-$NOW.log' && cd ../logs && echo '\n-- Outgoing data --' >> $LOGFILE && date >> $LOGFILE && echo " + info + " >> $LOGFILE

This works in terminal, but not as part of a python os.sys command?

How would I get this done?
Thank you :)

Cheap CMS Website Development! bMarket

See More: Bash log file with date as part of name

Report •

April 12, 2012 at 06:37:35
Perhaps the python program does not have the same environment as the bash does. I would change this relative command to a full path from:

cd ../logs

to something like:

cd /full_path__to_dir/logs

Report •
Related Solutions

Ask Question