Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

cron jobs and output and --quiet

2012-10-22
2013-05-09
  • Yuni Trunker
    Yuni Trunker
    2012-10-22

    I use a cron job to record 1 hour blocks of a stream.

    Since cron doesn't like the output from SR, you have to use -quiet…. BUT… I would like to capture that output to a file/log.

    Any way to pipe that to a file? ? I tried >> metatag.log and that won't run with cron even with -quiet.

    Any ideas??

     
  • VitaminJ
    VitaminJ
    2012-12-09

    The solution here is probably stream redirection of both stderr and stdout like streamripper >> /www/logs/crontab-streamripper.log 2>&1.

    Another issue is that cron doesn't provide an environment for commands run from there. You put '>> metatag.log', but I would bet that the pwd inside cron is not what you think it is. Try using the full path '/home/username/metadata.log'.