cron job for phython script

Hello,

How do I schedule a cron job for a phython script to run every hour?

Also, in case in future I decide to edit/cancel the job how should i do it?

Does it matter where my phython script is located? Also, I have am using mailx utility in my script to send me an email and dont want the cron job to send me an email. Is that doable?

# this command will run hourly.
01 * * * python.py

I get this error :

bash-3.00# 01app_stats.py
bash: 01
app_stats.py: command not found

Can you help?

You forgot all the spaces in that. But I don't think it's quite right anyway.

0 * * * * /path/to/script.sh

Put it in your user crontab, don't type it in the commandline. Edit your user crontab by running crontab -e .

do i need to log in as sudo user to do that? Also, incase i want to change or delete the cron job how do i do it?

Nope. Just crontab -e as your user and you should be able to edit your cron table -- unless you're not in the cron group, in which case it will tell you that.

Each user gets their own crontab, so you could crontab -e as a different user and they'd have their own entirely separate list of cron stuff.

To delete it later, crontab -e and just delete that line.

sorry, if this sounds too dumb but how do you delet the line?

---------- Post updated at 01:45 PM ---------- Previous update was at 01:40 PM ----------

Also, when i do:

crontab -e
309

Its showing me some 309...whats that? Also, should i just start typing in ? to add a cron job? how to save?

Is 309 all it shows you? Don't know what to tell you. Usually you get an editor like vi.