How to add a script to Crontab?

Hi!

We are on AIX 5.3

I have a script that must be run once every hour.

How do i add this to the crontab?

I know how to access crontab which is, crontab -e.

What do i do after that ? If i have the path to the script?

Thank you!!!

Add a line like this:

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

This will tell cron to run /path/to/script.sh on minute 0 of every hour, day, month, and weekday.

If the script doesn't run quite properly from cron, it's probably because cron's default PATH is much more minimal than a user would have, either hardcode a sane PATH in the script (export PATH="...") or read in /etc/profile with . /etc/profile

1 Like

I only guess this code but i am glad you confirmed it.

So is the command "crontab -e " correct ? to enter that code to schedule the script?

After that if i want to make changes to that script how do it do that ?

Thanks for all your help!

Then you crontab -e again and change the settings to what you want for it (edit the line).

1 Like

Thank you! All my concerns are cleared

1 Like