homepage Welcome to WebmasterWorld Guest from 54.163.72.86
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Edit crontab.vim file
How do i run program through crontab.vim file
BobParson




msg:3463036
 7:04 pm on Sep 27, 2007 (gmt 0)

Hi All,

I am having a problem to run a program through crontab.vim file which is located in this directory:/usr/share/vim/vim71/syntax/crontab.vim. When i run a shell script program by putting my file . It does not run.

Any help will be appreciated..

Thanks

 

jtara




msg:3463093
 8:04 pm on Sep 27, 2007 (gmt 0)

I'm not sure what you are asking.

crontab.vim isn't used to "run a program". It's a file which comes with the vim editor. It tells vim how to parse crontab files, so that it can display them with neat colors.

There's probably nothing that you should be doing with crontab.vim, except leaving it alone.

wheel




msg:3463245
 10:43 pm on Sep 27, 2007 (gmt 0)

On my system, if you enter:
crontab -l
it lists all the cron jobs. To add a new cron job or edit the existing ones I would enter this:
crontab -e
Which will open an editor. You don't put the programs themselves in there, just the one line per script that points at the script and tells it when to run. So I would see a file like this:
0 3 * * * /path/to/my/script
which would run that script at 3 in the morning every night. Of course I have to make sure that executing
/path/to/my/script
actually works directly from the command line.

In other words, you edit the crontab using the crontab -e command, but that's just the list of individual programs to run using cron. And don't edit it using vim, use crontab -e.

HTH.

BobParson




msg:3463962
 4:27 pm on Sep 28, 2007 (gmt 0)

Can you please tell me how can I run cron jobs using vim editor? I am using cygwin and vim editor.

Thanks

wheel




msg:3465299
 5:40 pm on Sep 30, 2007 (gmt 0)

You don't 'run cron jobs through vim'.

First you create a script. That script could be writtin in PHP, or Java, or a shell script, or in whatever. You can run this script from the command line. THis step has nothing to do with vim or cron. You just need a program of some type that already can be run on your server.

You then use a command like 'crontab -e' which will launch vim to edit the crontab file. You edit this file to tell it what time and dates to run the above script.

You don't use crontab to create or edit scripts. You only use cron to run scripts that already exists, at specific times.

Sharper




msg:3496161
 5:16 pm on Nov 4, 2007 (gmt 0)

Bob,

Your question is a little confusing, but what you MAY be looking for is that your need to make sure your EDITOR environment variable is set to the editor you want to use while editing your crontab file. The exact syntax varies with what shell you are using, but one of the following two will likely work:

(sh style) Bash, ksh:
EDITOR=vim ; export EDITOR

(csh style):
setenv EDITOR vim

That is assuming that the command you type to use vim is in fact 'vim'. If it's actually vi, then set it to 'vi' instead.

After that, typing crontab -e will use vim to edit your crontab. To make the change in your EDITOR environment variable permanent, you'll need to change your startup .profile or .cshrc to include the command.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved