Every user has it's own crontab
.
To see it just type
crontab -l
and, yes you've seen it right, when you want to add a crontab
then simply do
crontab -e
for the first time you'll be asked about the editor to use with crontab
. As you are a newbie as you say, I'd recommend to use nano, it's the simplest editor to use.
The crontab itself works like this
MIN = Minute 0-60
HOUR = Hour [24-hour clock] 0-23
MDAY = Day of Month 1-31
MON = Month 1-12 OR jan,feb,mar,apr ...
DOW = Day of Week 0-6 OR sun,mon,tue,wed,thu,fri,sat
COMMAND = Command to be run Any valid command-line
So e.g. to trigger a job every 15 minutes only on monday, you do it like so
*/15 * * * mon /home/me/yourscript.sh
and YES it's very important that you put your cronjob into the crontab of the user which has enough rights to execute it.
So if your script needs to be root or a special user, make sure to su to that user and add the cronjob there.
Also very important!
cronjob is dumb! Yes I said it. Always make sure to enter the full PATH to the application/command/script
you are using, because crontab won't work with .bashrc
or similar. You always have to make sure that you tell cron where it can find the files and directories.
To answer the rest of your questions:
Of course it will run on it's own, that's what it's there for. But you need to check that cronjob really does it, or if it's missing something. E.g. log into a logfile to see if it really works.
And NO, a restart is not needed. A restart with linux is normally only needed, if you install a new kernel. For it to use you'd need to reboot. Almost everything else can be done without reboot in Linux. Of course there are exceptions, but in general this statement is correct.