Ubuntu :: How To Run .sh File Using Crontab

Aug 4, 2010

I have a .sh file which i want to run using crontab at a specific time with root privilege.

I put an entry in root's crontab as the following:

sh /home/vivek/ifconfig/college.sh

But, the file do not get executed at a given time.

View 1 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

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

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

Ubuntu :: Can't Create A New File Using Crontab

Apr 15, 2010

A couple days ago I noticed cron stopped working and now I can't create a new file using crontab -e. When I hit crontab -e I get the editor but after saving nothing comes up under crontab -l and the file is blank when I reopen it. I don't have a cron.allow or a cron.deny.

View 4 Replies View Related

Ubuntu :: Adding Text To A File From Crontab?

Jul 14, 2010

I want to append a text string onto an existing file from crontab. These do not work:

0 1 * * * cp "test" >> /home/xys/myfile.txt
0 1 * * * mv "test" >> /home/xys/myfile.txt
0 1 * * * cp 'test' >> /home/xys/myfile.txt
0 1 * * * mv 'test' >> /home/nys/myfile.txt

How can this be done?

View 9 Replies View Related

Ubuntu :: Run Rsnapshot From Cron Via Root's Crontab File

Nov 21, 2010

I am trying to run rsnapshot from cron via root's crontab file (crontab -e). If I run rsnapshot from the command line with sudo it works perfectly, however, if I run it from cron:

Code:
* * * * * /usr/bin/rsnapshot hourly >/tmp/crontab.out 2>/tmp/crontab.err
This does not work. The crontab.err file shows:

[Code]....

View 2 Replies View Related

Red Hat / Fedora :: Get Mail From The Crontab Log File?

May 6, 2010

I want to get mail from the crontab log file....

How to set log file in crontab and the second and how can i get mail from the crontablog file.

View 1 Replies View Related

General :: Do Scheduling Using /etc/crontab File?

Feb 11, 2011

i want to do scheduling using /etc/crontab file instead of using crontab -e that is crontab command on the terminal.i am appending to the crontab file in the /etc directory but the scheduling is not happening

View 7 Replies View Related

General :: Purpose Of /etc/crontab File?

Jun 7, 2010

I attempted to run various cron jobs as root - just general server make-tidy stuff. But if I edit the /etc/crontab file directly, these tasks don't get run. However, if I use crontab -e as root, these jobs appear to work. Any idea why this might be the case? Also, I understand that user cron jobs are stored in /var/spool/cron/<user> (including root). If this is the case, what's the purpose of the /etc/crontab file?

View 5 Replies View Related

Ubuntu Servers :: Crontab Or Other (script) To Automatically Replace File?

May 18, 2011

I have been searching for a few hours now trying to figure out the best way to have Ubuntu Server 8.10 copy and replace a file every week.

So for example:

File A (original file)
File B (replacement file)

I would want to copy File B from its location and replace File A each week automatically with out removing or destroying File B.

I've thought of doing a cron since I already have a job set for email piping. but I'm unsure of the best way to complete this task.

View 5 Replies View Related

Fedora :: Crontab To Set A File Playing At A Certain Time?

Jun 6, 2010

I used crontab to set a file playing at a certain time, this works fine; however I want this to run even if no-one is logged in (but the computer is on). I can't get it to do this

Line is: 30 06 * * * env DISPLAY=:0.0 /usr/bin/totem /home/adunaic/Playlist.pls

Okay I think the problem was with needing a GUI.

Using this instead works, but i only hear the sound when I log in. I think something needs to be doen to start the audio perhaps?

14 17 * * * export DISPLAY=:0.0 && /usr/bin/mpg123 /home/adunaic/alarm.mp3

View 8 Replies View Related

General :: Create A Crontab That Renames A File?

Oct 8, 2010

I've tried to create a crontab that renames a fil extension every minute. This is what I've tried:*/1 * * * * / rename /home/bodil/Avräkningsfiler/'s/.txt/dat/' *.txtBut it doesn't seem to work.I've also tried to create a .sh file in the catalog itself with the command executing directly in the catalog but even though running the command by typing it in, it doesn't run automatically by cron

View 10 Replies View Related

General :: E-Mailing Whole Output Of A File With Crontab

May 3, 2011

I have this code that is 'bashed' regularly with crontab and basically it will send me an E-Mail of most of the output but it misses out some of it!

Here is the crontab code to automatically run the script:

Code:

So that sends me an E-mail with most of the output of the following code:

Code:

It sends me everything up to echo "*******" "Begin compressing and transferring files" "*******" but it wont output the tar bit.. so it should give me a list of files that have been tarred.

View 1 Replies View Related

General :: Cron / Crontab - Do Not Edit This File

Mar 19, 2011

I am trying to have the files from /user/directory copy every hour to /backup/user/directory. It would seem that cron or crontab is what I need to use. Looking at previous posts and other documentation only shows how much I don't know. When I type crontab -e I get a blank file I can type into, seemingly using vi as the editor. I have no problem with that but when I type cron -l, I get my text after a message about "Do Not Edit this File". What I am reading just makes no sense, I am not understanding even the most fundamental aspects of cron or crontab. Where I can get the most basic of basic instructions to try to understand this function?

View 4 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

General :: Script File Fails When Run From Crontab / Sort It?

Dec 29, 2010

Is been a while since I was last here requesting help. Now I need some of that LQ magic. I have a script file that extracts data for a date range, create a zip file for the data and then ftp it to a remote server.
Now the script is working perfectly if it is run manually, but now I want it to execute automatically. So I use the crontab, but for some reason the script fails when run from the crontab.code...

View 3 Replies View Related

Server :: Stop Squid Before Executing Crontab File?

Mar 14, 2011

I am using squid 2.6 on my cent os 5 .I want to shutdown the system at 7:00 pm for that purpose I write in# crontab -e 0 19 * * * /sbin/shutdown -h nowThe thing which I want to clear that when the system will going to turn off it will also stop squid service? If not then how can I automatically stop squid service and then crontab file execute

View 6 Replies View Related

General :: Unable To Find Directory Listed In /etc/crontab File?

Feb 10, 2011

when a script in /etc/cron.d directory will be executed?. I know that scripts in cron.daily will be executed daily [ set in /etc/crontab file]? Cant able to find this directory listed in /etc/crontab file?

View 2 Replies View Related

Software :: Sftp Crontab - Send Make-up File Daily

Oct 25, 2010

I use the following code to send make-up file dialy via sftp with expect. When I run it from command line, it has no problem sending to the remoteSERVER side, but when it is running via crontab task, it did not do the put, so did not execute the batch file defined in -b option.

#!/bin/bash
#!/usr/bin/expect
curDate=`date +%Y%m%d`
filename="$RESULTS/make-up.${curDate}.001"
newname="make-up.${curDate}.001"
remoteDirName="/Inbound/PPP"
tempcmd="$RESULTS/tempcmdFiles"
[Code]...

View 1 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 :: 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

General :: When Type "crontab -e" To Edit The File, It Is Not Opening In The Editor & Showing Output As "285"?

Aug 8, 2011

when I type "crontab -e" to edit the file, it is not opening in the editor & showing output as "285". I just wanted to edit crontab, So could anybody please tell me which is the real file of crontab, so I can manually edit that file using vi editor or nano. Or if that default editor is corrupted when I type "crontab -e", how can I change default editor before using "crontab -e" command. I will be waiting for your kind reply

View 2 Replies View Related

Ubuntu :: How To Use Crontab

Sep 1, 2010

How to use crontab? i need to set crontab to execute a file every 1 minute

View 2 Replies View Related

Ubuntu :: Can't Get Crontab To Work / Fix It?

Jan 10, 2010

Let me first start by introducing myself. I'm completely new to Linux. I've always argued Windows was better, even if I secretly thought not. Anyways the time has come to make the transition (I'm moving into computer forensics so I need to learn linux )

SO i'm trying to use crontab -e. I've installed gnome scheduler as I'm not comfortable editing in command line yet.

I've setup blackjack to start everyday at 23.30. The command line I've entered is /usr/games/blackjack and this works perfectly fine in command line.

View 2 Replies View Related

Ubuntu :: Crontab Commands Won't Run?

Jan 21, 2010

Edit: commands like Firefox works after I set it to display properly. I still can't get personal scripts to run, though.I can't seem to get crontab to run my commands. I add

Code:
* * * * * /home/username/script
but it doesn't seem to work. The script works itself in the shell

View 1 Replies View Related

Ubuntu :: Schedule A GUI App With At Or Crontab?

Mar 2, 2010

I want to schedule a Java program to run at a certain time, which will open a GUI progress monitor while it runs, and then terminate when it's done. I can execute it fine from the command line, but I it doesn't seem to work when I schedule it with crontab. In fact, I can't make any gui by scheduling it, not even something like gedit or firefox.

I know it's pretty rare that someone would want to do this, but is there any way to schedule a GUI app?

View 1 Replies View Related

Ubuntu :: How To Restart Gdm From Crontab

Jun 16, 2010

I'm having problems trying to restart gdm from crontab and I'm not sure what I'm doing wrong. Basically what I want to do is a 'logout' every morning before I get to work so that by the time I get to my computer I would just have to log back in and have a fresh gnome session.

The command I'm using to restart gdm is:

Code:
/usr/sbin/service gdm restart

If I run this command from a terminal as root it works.

To edit my crontab file I'm doing:

Code:
sudo crontab -u root -e

And adding the following line to it:

Code:
25 08 * * 1-5 /usr/sbin/service gdm restart

My understanding is that this should restart gdm every day of the work week (Mon-Fri) at 08:25. But for some reason this is not happening.

I also checked that my cron deamon is running by:

Code:
~$ service gdm status

gdm start/running, process 27156

View 5 Replies View Related

Ubuntu :: Some Of Crontab Don't Run / Get It To Work?

Aug 19, 2010

Figure out why this /etc/crontab won't run correctly?
Is it possible that it don't run because the cron deamon is not running? code...

View 1 Replies View Related

Ubuntu :: Rsync - .sh And Crontab

Feb 14, 2011

I'm currently trying to have crontab to automatically backup files from ramdisk. It works perfectly when I run it myself by simply cd:ing to scripts directory and type ./save_world.sh.

The problem is, that crontab DOES (at least it looks like it) run that command every one minute. /var/log/syslog does show it executing that line every one minute without any errors. I'm currently very confused what I did wrong here. I have tried rebooting, fiddling with crontab line, tried sudo crontab -e but nothing seems to work.

My script is called save_world.sh and it is located in /home/phoe/minecraft/rpg/

Code:

My crontab -e has one line and it is following:

Code:

I haven't determined any specific time yet, because I'm just trying to get it work first.

Snippet from /var/log/syslog:

Code:

View 4 Replies View Related







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