0

I have an instance of Ubuntu 22.04 LTS running on a server. I need SpiderOakONE to launch automatically on reboot without the user having to log in. I decided this would be best suited to cron. I created a crontab for my current user using crontab -e and added this line:

@reboot sleep 5 && /sbin/start-stop-daemon -b -x /usr/bin/SpiderOakONE -S

The systemd cron service is active and my syslog says that cron starts the job but nothing else. There are no error logs or info logs related to SpiderOakONE.

To test, I rebooted my server and waited a few minutes before testing whether the server will sync with SpiderOakONE and it did not work.

Is the cron job set correctly? Am I perhaps not waiting long enough for SpiderOak to start? It takes a good long time to sync when a user logs into the server so perhaps thats happening but I'm really not sure.

Any suggestions?

7
  • @reboot means the start of the cron-daemon. Could it be, that this is started, before the network is up?
    – Marco
    May 18, 2023 at 15:44
  • The start-stop-daemon command needs --start as first option. Besides this, I think this is not the right command in this setting. Maybe remove the start-stop-daemon command might work even better.
    – Marco
    May 18, 2023 at 15:54
  • --start is equivalent with -S no? I'll change it round. Also, how would I launch the executable without the start-stop-daemon? What would I use instead of the daemon? Would cron just recognise that /usr/bin/SpiderOakONE is an executable and start that?
    – Joe Moore
    May 18, 2023 at 15:55
  • @reboot sleep 5 && /usr/bin/SpiderOakONE might work.
    – Marco
    May 18, 2023 at 16:00
  • 2
    If you have root access to the server you can use systemd with dependencies. Otherwise the easiest way is to increase the sleep. More sophisticated would be to check the network, e.g. with systemd-networkd-wait-online
    – Marco
    May 18, 2023 at 16:41

1 Answer 1

0

Turns out, SpiderOakONE has a built in --headless option you can add on launch.

@reboot sleep 60 && /usr/bin/SpiderOakONE --headless 2>&1 | logger -t SpiderOakLog

This was my final crontab. The 2>&1 ... part isn't necessary, it just allows the info/errors to be logged to syslog instead of an MTA error.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .