Sponsored Content
Full Discussion: editing crontab help
Operating Systems Linux Fedora editing crontab help Post 302451831 by methyl on Wednesday 8th of September 2010 07:03:44 AM
Old 09-08-2010
Assuming you are trying to add a line to the existing root cron and that you are happy to run "mysqldump" as the user "root".

Code:
1) Review your proposed crontab entry after also reading the suggested instructions in post #2.
The environment under cron is quite different from the command line.
The proposed cron line will probably be best as a named script because you will invariably have to set
some environment variables before running "mysqldump"
(not least of which would be $PATH so you can find the program).

Though stating the obvious this cron will fire at 05:11 (early hours of the morning) 7 days a week.
11 05 * * * mysqldump -u ruth -ppassword -h localhost world > /home/ruth/backup/world_try

2) Set the environment variable "EDITOR" to your normal editor and export the variable.
# If your normal editor is "vi"
EDITOR="vi"
export EDITOR

3) Copy the root crontab in case or accident
crontab -l > /tmp/root_crontab_saved

4) Edit the crontab
crontab -e

In the editing session insert your new line into the crontab.
Whether you do this by typing it or by importing your existing file is up to you.
There will then be two distinct lines.
At the end of your editing session when you save the file the crontab will become active.


Reference: The instructions referred to in post #2 are quite good.

Last edited by methyl; 09-08-2010 at 08:05 AM.. Reason: layout
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Editing Crontab

Hi I am not able to edit crontab. Following is the comand that is being issued $crontab -e 2764 ............ This is what I am able to see But when I do $crontab -l List of all the crontab entry is displayed. Also I am seeing one entry in my /etc/cron.d prw------- 1 root ... (6 Replies)
Discussion started by: pankajkrmishra
6 Replies

2. Shell Programming and Scripting

need help in file editing:-

I have 2 files:- file1 and file2 file1 SEED RPTT TST8 file2 SEED:db1:Y RPTT:db2:Y SED8:db2:N TST8:db:Y TRN8:db:N CNV8:db:Y TEST:db:Y I have to change third field of file2 to "y" for every entry in file1 matches first filed of file 2 and rest to N (2 Replies)
Discussion started by: okreporthai
2 Replies

3. Solaris

editing crontab with vim and using .vimrc

Hi since we migrated from Solaris 8 to Solaris 10 I do miss a nice feature when editing crontab with vim editor: no more color highlighting after starting to edit. Well there is a hack, see below. I did define: export EDITOR='vim -c ":source /export/home/duc904/.vimrc"' Under Sol8 when... (2 Replies)
Discussion started by: duc904
2 Replies

4. UNIX for Dummies Questions & Answers

Editing a cron file with crontab

I want to set up a file with crontab to run the cron deamon so I can use at to schedule jobs. I think the crontab file (or whatever you call it) has to be set up. Currently, I don't have a crontab file (I checked by typing sudo crontab -u myusername -l), and I don't know the syntax for creating... (6 Replies)
Discussion started by: Ultrix
6 Replies

5. UNIX for Dummies Questions & Answers

Editing crontab of non-root user from file

Hi All, Ref: "build crontab from a text file" in same forum. (I am not allowed to post URL's in the first post) We are reorganizing our UNIX Crontab file by first making changes in a word pad text file. The intent is to then copy it back to Crontab. Will this work? Copy and Paste does not... (6 Replies)
Discussion started by: nivedhitha
6 Replies

6. Shell Programming and Scripting

Editing crontab via ksh

Hi all, I am trying the following I am hoping that the crontab would be changed. but it prints the previous crontab and says Can anyone tell me the correct ksh command that should be used here? I don't want to edit the crontab with crontab -e, I need to edit it via ksh. Thank... (2 Replies)
Discussion started by: ajaba
2 Replies

7. Shell Programming and Scripting

Need help in editing a file

I have a file which has 10 million records in it. When am trying to edit the file with vi, the following error occurs: ~ ~ ~ ~ ~ ~ ~ ~ "file1" Value too large for defined data type Is there any way that I can edit this file without using vi? Any help would be really appreciated.... (8 Replies)
Discussion started by: bobby1015
8 Replies

8. Shell Programming and Scripting

Need help regarding String editing

Hi Geeks I am working on trimming the logs and extracting the XMLs from it. I am facing one problem here. My XML String is ending with ...........Request></Body></Envelope>S/R sometimes there is more then just S/R in the end. I want to delete anything comes after </Envelope>... (3 Replies)
Discussion started by: santy00110011
3 Replies

9. Solaris

Crontab editing issue

Hi, OS - SunOS I gave crontab -e then it returns zero. $ crontab -e 0 ? ? Crontab status - $ ps -ef | grep cron root 2481 1 0 May 12 ? 0:18 /usr/sbin/cron Please help (9 Replies)
Discussion started by: nag_sathi
9 Replies

10. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies
AMDUMP(8)						      System Manager's Manual							 AMDUMP(8)

NAME
amdump - back up all disks in an Amanda configuration SYNOPSIS
amdump config [ host [ disk ]* ]* DESCRIPTION
Amdump switches to the appropriate Amanda configuration directory, e.g. /etc/amanda/config, then attempts to back up every disk specified by the amanda.conf file. Amdump is normally run by cron. You can specify many host/disk expression, only disks that match an expression will be dumped. All disk are dumped if no expression are given. If file /etc/amanda/config/hold exists, amdump will wait until it is removed before starting the backups. This allows scheduled backups to be delayed when circumstances warrant, for example, if the tape device is being used for some other purpose. While waiting, amdump checks for the hold file every minute. See the amanda(8) man page for more details about Amanda. EXAMPLE
Here is a typical crontab entry. It runs amdump every weeknight at 1 a.m. as user bin: 0 1 * * 1-5 bin /usr/sbin/amdump DailySet1 Please see the crontab(5) or crontab(1) manual page for the correct crontab format for your system. MESSAGES
amdump: waiting for hold file to be removed The "hold" file exists and amdump is waiting for it to be removed before starting backups. amdump: amdump or amflush is already running, or you must run amcleanup Amdump detected another amdump or amflush running, or the remains of a previous incomplete amdump or amflush run. This run is ter- minated. If the problem is caused by the remains of a previous run, you must execute amcleanup(8) and then rerun amdump. AUTHOR
James da Silva <jds@cs.umd.edu> University of Maryland, College Park SEE ALSO
amanda(8), amcheck(8), amcleanup(8), amrestore(8), amflush(8), cron(8) AMDUMP(8)
All times are GMT -4. The time now is 12:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy