Create cron job without root

Hi there,

I need to create a crone job to backup certain files on my disk without root permissions.
Also if I will be able to edit cronetab then I need to know how to edit it with any editor other than vim :mad:

What OS are you using?

centos 5.10, 64-bit

try $editor=(your choice of editor)
$export editor
then...
try crontab -e (your username)

---------- Post updated at 10:32 AM ---------- Previous update was at 10:28 AM ----------

Amend: your Editor statements might be upper case i.e.: EDITOR=(...)

Most UNIX have a /var/adm/cron/ directory where you find the allow and deny files for cron and at command but in linux I suppose you find then in /etc...
Just to say that to be able to use cronfiles the user must be allowed, if you dont have a cron.allow or cron.deny file then it should be OK, if not the user must be added...
As to edit... you would have to create your crontab file first following its syntax:

#  Minute    Hour    Month_Day    Month    Weekday    Command
#  (0-59)   (0-23)   (1-31)       (1-12)   (0-6)*0=sun run-string 
#  * = in any crontab field represents all legal values.

But linux has more options to it

Lets call the file user.cronfile
Once that done you just as user execute this way:

 crontab user.cronfile 

Now each time you want to modify - 2 options :
Either you edit your fuser.cronfile modify and save with the editor of your choice...
and you need to load the modified file again:

 crontab user.cronfile 

OR
You use, being the user:

 crontab -e 

to modify and save ( but its strangely looking like vi hehe...)

vi-hater's cheat sheet for vi:

  • i: Stop beeping at me and enter writing mode you stupid program
  • esc-:-w-q-enter: Save and quit
  • esc-:-q-!-enter: Quit without saving
  • esc-d-d: Delete a line because backspace isn't good enough for you
  • esc-esc-esc: what in the world are you doing now, quit it, stop doing that

They told me I would come to love vi as I learned to use it. That of course never happened. Knowing the basics is still useful.