0

I am using Ubuntu 16.06 and here is my shell script:

#!/bin/sh

recordmydesktop --quick-subsampling --fps 3 --no-sound --on-the-fly-encoding --v_quality 40 -o /home/square/Videos/test/rec_`date +%Y%m%d_%H%M%S`.ogv

when i run the script from the terminal like that ./script.sh everything goes well and running.

However when i place an cronjob looking like that:

*/1   *    *    *    *  /home/square/playground/script.sh &>/home/square/playground/mylog.log

The command:

recordmydesktop --quick-subsampling --fps 3 --no-sound --on-the-fly-encoding --v_quality 40 -o /home/square/Videos/test/rec_`date +%Y%m%d_%H%M%S`.ogv

Is not working. I have no idea why it is running when i run the script.sh from the terminal, but it is not working via the cron job.

Do you have any idea how i can fix that ?

1 Answers1

0

recordmydesktop records the X-session it is started in.

Processes started from crontab don't have an X-session.

Soren A
  • 6,799
  • Is there anyway i can start that with cron or with the starting of the PC ? – Venelin Vasilev Nov 17 '16 at 10:03
  • I really don't think so. As far as I can see, you have to start it after you have logged in. – Soren A Nov 17 '16 at 10:13
  • 1
    But maybe you can use Startup Applications in your Desktop. It should be found in "Menu > Preferences > Startup Applications", see this article http://askubuntu.com/questions/30931/how-do-i-make-a-program-auto-start-every-time-i-log-in – Soren A Nov 17 '16 at 10:15