Score:0

Crontab not running @reboot

us flag

I have ubuntu server with crontab that is supposed to run mkdocs in tmux at reboot. Worth noting is that I configure crontab by going into crontab -e. Line is:

@reboot /usr/bin/tmux new-session -d -s "MKDOCS" "cd /root/mkdocs && mkdocs serve -a 192.168.0.10:8080"

However, nothing happens.

I have tried just /usr/bin/tmux new-session -d -s "MKDOCS" "cd /root/mkdocs && mkdocs serve -a 192.168.0.10:8080" and it runs fine. What can be the reason? Thanks

in flag
Does this answer your question? [Why is my crontab not working, and how can I troubleshoot it?](https://serverfault.com/questions/449651/why-is-my-crontab-not-working-and-how-can-i-troubleshoot-it)
cn flag
Bob
As described in the linked Q&A fairly common are missing newlines on the last entry of a crontab file and relying on relative path names for commands that do not live in the very limited `$PATH` used by cron. - On a different note: most sysadmins prefer services that actually run as a service rather than in tmux/screen session.
us flag
@GeraldSchneider There is no mention of the reboot option on that page.
us flag
@Bob the path shouldn't be an issue, if you notice I am running commands with full path. ( example instead of Tmux I am running /usr/bin/tmux). I know but this is a temporary solution and there are reasons I am doing it this way, however the corn doesn't seem to do anything at reboot.
in flag
So, you did check that it works when you enter an actual time instead of @reboot?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.