Running Mint 18.1 Serena, but I am sshing into the box vs. using the gui. I've tried everything. Here's my cron entry:

@reboot sleep 60;/bin/sh /home/test/Applications/scripts/startup.sh

This is in user test's crontab -l.

folder permissions:

File: 'scripts/'
Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: 821h/2081d      Inode: 58843171    Links: 2
Access: (0755/drwxr-xr-x)  Uid: ( 1000/    test)   Gid: ( 1000/    test)
Access: 2017-03-31 16:32:42.771206606 -0700
Modify: 2017-03-31 16:31:19.322038792 -0700
Change: 2017-03-31 16:31:19.322038792 -0700
Birth: -

startup.sh permissions:

File: 'startup.sh'
Size: 432             Blocks: 8          IO Block: 4096   regular file
Device: 821h/2081d      Inode: 58726626    Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/    test)   Gid: ( 1000/    test)
Access: 2017-03-31 16:32:25.178476590 -0700
Modify: 2017-03-31 16:31:19.306039143 -0700
Change: 2017-03-31 16:31:19.306039143 -0700
Birth: -

and the contents of startup.sh:

#!/bin/sh
kill $(cat /home/test/Applications/test1/pycpoint.pid)
cd /home/test/Applications/test1
sh test1 
cd ~

screen -d -m test2 runserver 192.168.86.110:8008

Not sure what I've done wrong or why this isn't working. Also tried adding it to init.d/ and have created startup.service and tried it that way. No dice, ever. Script works if I execute it from the command line.

cron reports this from grep cron /var/log/syslog:

Mar 31 17:51:16 htpc systemd[1]: Started Run anacron jobs.
Mar 31 17:51:16 htpc anacron[889]: Anacron 2.3 started on 2017-03-31
Mar 31 17:51:16 htpc anacron[889]: Normal exit (0 jobs run)
Mar 31 17:51:16 htpc cron[909]: (CRON) INFO (pidfile fd = 3)
Mar 31 17:51:16 htpc cron[909]: (CRON) INFO (Running @reboot jobs)

Help?

  • Make sure you have local email set up and check the user's mailbox. Cron sends you a mail with the command's output, including error messages. – Gilles Apr 1 '17 at 1:30
  • can it do it locally? and how? – chow Apr 1 '17 at 6:13
  • Cron and other system tasks send email using whatever email server is installed on the machine. This doesn't require a network connection since it's calling the email server locally. Many distributions including Mint unhelpfully omit an email server from their default installation, you should include one. The answers in this thread may help. – Gilles Apr 1 '17 at 11:35

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.