Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run a command at boot time that basically looks like this:

python /home/me/.hidden/

Also, this needs to run as me, not root.

I know it can be done, but my google-fu is weak today.

BTW, this is a headless server, so starting at login isn't a solution.

share|improve this question
up vote 6 down vote accepted

You can use the @reboot cron target.

Edit your user account crontab by using the crontab command:

$ crontab -e

Then instead of minute hour day month day of week, simply put @reboot

@reboot python /home/me/.hidden/

For more info on @reboot and other cron special strings, read the crontab 5 manpage.

$ man 5 crontab
share|improve this answer
This worked for me. As a note: the python script I was using didn't like to be called the way I had it listed above, so I created a simple script that cd'd into the directory then called the python script. – Tymanthius Feb 25 '13 at 13:51
You may also put more than one shell command as the cron job. @reboot cd /home/me/.hidden; python – Jay _silly_evarlast_ Wren Nov 25 '14 at 14:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.