VectorLinux
September 30, 2014, 02:08:54 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: Can't edit crontab  (Read 2701 times)
mlevins
Member
*
Posts: 5


« on: December 03, 2008, 10:52:07 am »

When I type in crontab -e, I can enter the commands I want to run, but nothing is ever added to the file.  Can someone explain to me how cron is working under this system?  I am logged in as root and am trying to save with a vi "wq".
Logged
bigpaws
Vectorian
****
Posts: 1850


« Reply #1 on: December 03, 2008, 01:08:46 pm »

Not to be smart did you try crontab -l to see the
crontab entries?

Bigpaws
Logged
mlevins
Member
*
Posts: 5


« Reply #2 on: December 03, 2008, 02:40:09 pm »

Yes, this is the output:

# Run hourly cron jobs at 47 minutes after the hour:
47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null
#
# Run daily cron jobs at 4:40 every day:
40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null
#
# Run weekly cron jobs at 4:30 on the first day of the week:
30 4 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null
#
# Run monthly cron jobs at 4:20 on the first day of the month:
20 4 1 * * /usr/bin/run-parts /etc/cron.monthly 1> /dev/null

I am trying to add the line: 30 12 * * * /usr/bin/freshclam below the daily batch jobs at 4:40am.
Logged
bigpaws
Vectorian
****
Posts: 1850


« Reply #3 on: December 03, 2008, 03:11:52 pm »

try :w and then :q!

Bigpaws
Logged
overthere
Vectorian
****
Posts: 1281



« Reply #4 on: December 03, 2008, 04:14:55 pm »

If cli isn't working for you, you may also open the file manager as root, click file system and goto /var/spool/cron/crontabs and right click and open in a text editor. add your line and save the file.
hope that helps
cheers
Logged

Everything Is Relative
asphyx
Member
*
Posts: 9


« Reply #5 on: January 12, 2009, 02:30:23 am »

If cli isn't working for you, you may also open the file manager as root, click file system and goto /var/spool/cron/crontabs and right click and open in a text editor. add your line and save the file.
hope that helps
cheers

In VL 5.9 that decided me :
Code:
vi /var/spool/cron/crontabs/root

This file is the same like the answer from crontab -e, make the changes for hours, minutes, week, month then save the file and enjoy ! Smiley
Logged
Pita
Vectorian
****
Posts: 1310


« Reply #6 on: January 12, 2009, 03:31:15 am »

I have been wondering myself for years why vi or lately even worse 'evil' (I think that's the wrong name) anyhow something like that is used to edit crontab. I have struggled ever since with it. My solution is using the editor of 'mc' and it works as someone else suggested more or less.
Logged
kidd
Packager
Vectorian
****
Posts: 682


« Reply #7 on: January 12, 2009, 04:44:21 am »

vi has been standard editor for years,  and lately vim has replaced vi in most systems.  Many users won't even notice many differences between vi and vim.  However, vim is much more powerful and extensible than plain vi.

Anyway, editors are one of most religious decisions in linux world, so I won't start with typical blablabla....

crontab, as many other commands like vipw or vigr use $EDITOR environment var to launch the editor.  just change it to nano, emacs or whatever console editor you prefer.

:wq
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!