General :: Remove Line From Crontab?

Aug 26, 2010

I have exactly same line like in crontab and I want to remove it via shell script. How to do it?

Example:
In crontab there are:
*/1 * * * * /home/testdir/testcron.sh >/dev/null 2>&1
line, how to remove it using shell ?

View 14 Replies


ADVERTISEMENT

General :: Crontab Not Working \ Edited Crontab File Using Crontab -e?

Apr 27, 2010

I am using Linux 64 bit Redhat Linux. I am trying to setup simple crontab as follow...1. Edited crontab file using crontab -e2. Listed the file once to verify it using crontab -l. This will display as.. 18 5 * * 2-3 ksh $HOME/testScript.sh > $HOME/testscript.out3. Logged in a root and restarted cron deamon using "/etc/init.d/crond restart"As per my understanding now my testScript should start running at 5:18 am Thuesday

View 3 Replies View Related

General :: Possible Disabling Crontab Job Without Deleting Crontab Description Entry

Jun 23, 2011

is it possible disabling a crontab job without deleting the crontab description entry (by crontab -e)?I could also accept to change the entry itself. Now it's:0 0 * * 0-6 /home/me/cron/script.csh

View 4 Replies View Related

Server :: Crontab Fails But Command Line Works ?

Feb 19, 2011

Having an odd problem running a mysqldump via crontab. I have the script running on other servers and they work fine, so not sure how to actually troubleshoot, but the script looks like the following;

If I run it as a cronjob as root, it finishes in a second and a 20k file is there. If I run it from the command line as root it does the backup (takes a few minutes) but does complete the backup and can be unzipped and read successfully.

View 3 Replies View Related

General :: Remove Specified Line From Text?

Feb 12, 2011

I wish to move a specified line from a text file:

Quote:

ltoremove=5 #remove 5th line
i=1
while read line ; do

[Code]....

how should this actually be done? is there a shorter faster way to do this?

View 7 Replies View Related

General :: Remove Line Breaks From Lines Ending With A Comma?

Nov 10, 2010

I have a CSV file that's created in an application that can't output lines longer than 250 characters. the data fields, all together, are longer than this. how would I remove the line break from every line that ends with a comma? For example:

A,B,C
D,E,
F
G,H,I

becomes:

A,B,C
D,E,F
G,H,I

View 1 Replies View Related

General :: Remove / (slash) And Replace - (semi-colon) With New Line

May 6, 2011

I need to have a shell script which does the following,

1. Remove '/' in the file
2. Replace ';' with new line

Input file (sample):

TL/01039;TL/07014;TL/07016;TL/07046;TL/09476;TL/09522

Output file should be:

View 2 Replies View Related

General :: Using Grep To Remove Line And Write Back To Same File?

Feb 10, 2010

remove a line starting with specific word with grep. Here is what I found

grep -v '^cc$' data.txt

Here I remove all lines with on 'cc' in that line. But I want the result write back to data.txt

I try several ways

grep -v '^cc$' data.txt > output.txt # works but to another file
echo `grep -v '^cc$' data.txt` > data.txt # didn't work, all carets gone, become one line
grep -v '^cc$' data.txt > data.txt # data.txt is empty after running this

How can I save the result of grep to the input file?

View 4 Replies View Related

General :: Difference Between /etc/crontab And "crontab -e"

May 29, 2011

What is the difference between the crontab located in /etc/crontab and the crontab that can be edited using crontab -e?

View 2 Replies View Related

Programming :: Remove Line Break If Next Line Does Not Start With "PX"?

May 25, 2011

I have a big csv-file wich is not formatted very well. I clean it up with removing a lot of html etc, but some of the lines breaks where they are not supposed to.What I want to do is to check next line, if it starts with 'PX' I don't want to do anything, but if it does not start with 'PX' I want to merge the two lines. That is removing the newline character on line one and replace it with a space.Can this be done with sed? (or maybe with perl or something, but I'm more familiar with sed)I've been looking und the net to find a solution, but to no result.

View 8 Replies View Related

Ubuntu Servers :: After Using Crontab With /etc/crontab / Giving Error "can't Find Command Root"?

Aug 26, 2010

I have a question about using crontab with /etc/crontab...

I had a cron job that I needed to run as root. At the time I thought that sticking it in /etc/crontab would be a good idea. However, I used the crontab command to edit /etc/crontab, which I guess is not standard procedure? Specifically, I configured /etc/crontab as my local user's crontab (i.e. sudo crontab /etc/crontab) then added my cron job as I would a local user crontab (i.e. sudo crontab -e).

Originally, my cron job looked like this:

30 * * * * root /my/batch/script &> /dev/null

After adding the new cron job I started seeing errors. Something to the effect of "can't find command root" or something similar. So I removed the 'root' user definition from the cron job and the job started running fine. However, because this is /etc/crontab, there are other system related cron jobs that have been defined to run under the root account (e.g. "17 * * * * root cd / && run-parts --report /etc/cron.hourly" runs as root, etc.). So these pre-existing system cron jobs, which up until now have been running smoothly, are now generating "can't find command root" errors. But I think that the system cron jobs _are_ successfully being run someplace because logrotate seems to be working.

So what I _think_ is happening is that /etc/crontab is being run twice: once as the system crontab, and once as my sudoed local user's crontab. When I run crontab -l I see nothing, but when I run sudo crontab -l I can see the contents of /etc/crontab. I am reluctant to delete my sudoed local user's crontab, because then in the process I would be deleting the system crontab, and I do not know how I should restore the system crontab's contents. (I am still not sure as to the most appropriate way to edit the system crontab).

How can I get out of this mess? I want /etc/crontab to go back to the way it was before--running _once_ as the system crontab. As for my new cron job, I'm willing to reconfigure it anywhere so long as I am still able to run it as root. Any ideas? (I am using Ubuntu 8.04 Server LTE)

View 2 Replies View Related

Software :: Scheduling Backup In Crontab When Put This File In Crontab To Schedule The Backup Program It Wont Run?

Apr 9, 2011

I have installed an application manager(monitoring application) on my linux server. Now, i need to have backup schedule for my application. The application itself has executive file to backup database.But when i put this file in my crontab to schedule the backup program it wont run!50 09 * * * root /opt/ME/AppManager9/bin/BackupMysqlDB.sh

View 1 Replies View Related

Ubuntu :: Remove Specified Line From Text?

Feb 12, 2011

I wish to move a specified line from a text file:

Quote:

ltoremove=5 #remove 5th line
i=1
while read line ; do

[code]....

how should this actually be done? is there a shorter faster way to do this?

View 3 Replies View Related

Programming :: Using Sed To Remove All But The Last 17 Characters On A Line?

Jun 3, 2010

I'm having a bit of a headbanger trying to work this one out. I'm trying to remove all of the characters on a line apart from the last 17. For example, I need to change this:

Code:

00000000000000000089;0bbfaeb8
01000000000000000089;0bcb5948
00000000000000000089;0bcc4c40

[code]....

View 5 Replies View Related

Debian :: Remove Line From Sources List Using SED

Apr 18, 2016

I am trying to remove the line from sourses.list file but nothing happens. I understand that need to block "" and "[" but nothing comes out.

Code: Select allsudo sed -i 's/^deb cdrom:[Debian GNU/Linux 8 _Jessie_ - Official Snapshot amd64 LIVE/INSTALL Binary 20160402-21:58]/ jessie main$/g' /etc/apt/sources.list

View 5 Replies View Related

Red Hat / Fedora :: Remove Particular Line Of Text From All Php Files

Jul 21, 2010

My site was recently hacked and a line of <JAVASCRIPT> was inserted into all my php files. Is there a way to pull just that one line out of all the php files on the server? I was thinking of using a grep -iR <CODE> *.php then piping thru sed

View 1 Replies View Related

Security :: Using Sed To Remove A Line From All Files In Directory

Jan 23, 2010

A Javascript has crept into all my hmtl, php files in my shared hosting account. I have SSH access.How can I use sed to remove that line from all files in a directory recursively ?sed doesnt change the original file.And I need to specify *.php and *.html

View 4 Replies View Related

Programming :: Shell To Remove Line Matched With Variable?

Jul 25, 2011

I'm using sed to remove certain line in a text file based on a match with 2 variables from input. Here is how it looks like in file

Philip S:Odds:45:343
Mike Junior:Odds:3:56

I prompt for 2 inputs in variable form which is compared to the first 2 fields of the above text (: seperated). So say i enter Philip S and Odds then it should delete the entire first line.

View 4 Replies View Related

Programming :: Using Sed To Remove Line In A Comma-delimited File?

Mar 10, 2009

I have a script that output all my data in to a comma-delimited file separated by ";"

Current Output:

Quote:

"SAP 1117A";10.94.1.7;239.234.1.12;0;0;0;0;0;3;172.31.207.45;""
"";NA;239.192.1.50;0;0;0;0;0;3;172.31.207.61;""
"";NA;239.192.1.50;0;0;0;0;0;3;172.31.207.62;""

[code]...

I would like to remove all lines that have an NA in the second field.

New Output

Quote:

"SAP 1117A";10.94.1.7;239.234.1.12;0;0;0;0;0;3;172.31.207.45;""
....

View 4 Replies View Related

CentOS 5 :: Remove Temporary Files Through Command Line?

Jan 16, 2010

Where exactly are the temporary files stored, in /tmp or /var/tmp. How can i remove temporary files through command line? What is the difference between these two directories?

View 2 Replies View Related

Fedora Hardware :: Remove Via The Command Line Prior To Actually Starting?

Feb 17, 2010

Yesterday i finally got around to installing my graphics card (NVIDIA GeForce 8400M CS) on fedora 12 by using the command yum install kmod-nvidia the terminal then told me that it installed correctly so i rebooted my system. Now when i boot up into fedora, it loads and when the sign in window is about to appear instead my screen shows random colors all over the place. I am hoping someone can tell me how to remove this via the command line prior to actually starting fedora.

View 2 Replies View Related

Fedora :: Remove An Application From Gnome Startup Using Command Line?

May 27, 2011

I've just added an application to load on startup in gnome.At first gnome loads properly,but after few seconds that application starts automatically and I can see its icon on taskbar , then gnome freezes and I can't do anything in gui.

How I can remove that application from starup of gnome using command line?

View 1 Replies View Related

Programming :: Remove Line Containing Certain Variable - Bash - Permission Denied?

Jul 20, 2011

I am writing a bash script to run everyday and output results to a file. When the same results are produced i want to overwrite the line from the previous day. (Or remove and add). So if the script finds a variable in a line. i want it to output the results to that line . sed -i did not work for me; sed: couldn't open temporary file ./sedTvOCEg: Permission denied

View 10 Replies View Related

Fedora :: Write A Crontab Entry Using "crontab -e"

Jul 21, 2011

I was trying to write a crontab entry using "crontab -e"


Code:
0 0 * * * cp /var/log/httpd/domains/mydomain.net.log
/home/admin/logs/mydomain.net.log

crontab is giving me this error:

Code:
"/tmp/crontab.XXXXfMOnRS":2: bad minute
errors in crontab file, can't install.

I've tried a dozen different values for the minute, but it's still giving me the same error.

View 5 Replies View Related

General :: Crontab Can't Run / Why Is So?

Feb 1, 2010

I want to run a crontab job but it isnt working. I am writing in the crontab file with crontab -e Then I am waiting time but it isnt working. code...

View 6 Replies View Related

Ubuntu :: Quickly Remove Multiple Related Packages From Command Line?

Feb 15, 2011

Is there any way to quickly remove multiple related packages from the command line instead of having to enter the name of every single one? I am trying to remove OpenOffice from my server running 10.04. It would work nicely if I could get a list of packages without line breaks, such as the list displayed by aptitude when upgrading. That way I could just paste the package list into the terminal. However, "aptitude search 'openoffice'" dumps a long list on many lines that cannot be used that way.

View 3 Replies View Related

General :: Crontab: 12 3 12 4 4 Cat /etc/passwd?

Jan 5, 2010

If I configure a crontab like below.12 3 12 4 4 cat /etc/passwd I know that the cat command will get executed at the configured time. But where will the output of that command go?If it is something like below, then out put will be routed to /tmp/file1.12 3 12 4 4 cat /etc/passwd > /tmp/file1

View 4 Replies View Related

General :: How To Edit The Job Using Crontab

Jun 1, 2010

I setup a cron job to trigger a script that I wrote every morning at 12:00 AM, but it does not seem to be working.

This is how I edit the job using crontab -e

Why it isn't triggering at 12:00 am every night. If I run the script manually it works just fine so I know is not the script causing troubles.

View 7 Replies View Related

General :: How To Set Cronjob In /etc/crontab

Apr 10, 2011

I know crontab -e sets a cronjob in /var/spool/cron but how do I set a cronjob to run from /etc/crontab? Is there a command used for this or would I have to manually edit a certain file?

View 2 Replies View Related

General :: Set Up A Crontab So That From Machine {which Is 192.168.0.99}?

Dec 5, 2010

I want to set up a crontab so that from my machine {which is 192.168.0.99}whatever I create in a directory called "/information" {suppose some texts files}will be copied to 192.168.0.100 and 192.168.0.101's machine "/readinfo" directory at 5.30 pm. everyday."/readinfo" is directory which is accessible by all users on that machines {192.168.0.100 & 192.168.0.101}is this crontab right?30 5 * * * /bin/cp -rf /information/* 192.168.0.100:/readinfo30 5 * * * /bin/cp -rf /information/* 192.168.0.101:/readinfoI guess first these 100 and 101 machines should allow me {99} ssh connection without passowrd.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved