I have a Python script which simply writes some text and saves it to a file
#! /usr/bin/python3
def main():
filename = \'/home/user/testHello.txt\'
From what I've discovered just now, the @reboot
syntax seems to depend on what crontab
you're editing. I found that for the system-level /etc/cron.d/
folder, entries there must have a user, just like regular time-based crons.
Thus this worked for me, on Ubuntu 14.04, to run the specified command as root on startup:
@reboot root /home/vagrant/log.sh