Ubuntu :: Shell Script Not Working In Cron

Jan 20, 2010

I'm creating a script all worked fine in the command line. But not work in the cron. Below you could see the script

[Code]...

So far I found when I use corn following part not working, nothing goes to the processedfiles file. ls -l /var/lct/mou2/processed | grep $TODAY | awk '{print " " $8}' > /home/trans/mou/processedfiles ls -l /var/lct/mou2/processed | grep $YESTERDAY | awk '{print " " $8}' >> /home/trans/mou/processedfiles This work perfect in command line. Corn job and command line use by the same user.

View 6 Replies


ADVERTISEMENT

Ubuntu :: Scp From Shell Script Using Cron

Oct 12, 2010

I have a script that I would like to run using 'cron'. I want to use 'scp' to transfer files from one machine to another. I have set up the SSH keys on both machines. When I run the script from bash terminal, it works flawlessly. But when I schedule a 'cron' job to run the same script, 'scp' does not transfer the files.

'Return value' is 0 when the script is run from bash directly. But when it runs from 'cron', the 'Return value' is 1. That means, surely, that 'scp' is throwing an error. I don't know which error is being encountered. Could anybody let me know how to make it work?

View 8 Replies View Related

Ubuntu :: Write A Shell Script To Add Job To Cron?

Apr 1, 2011

I write a shell script below to add a job to cron.

#!/bin/sh
touch date.cron
echo '*/3 * * * * /usr/sbin/ntpdate 192.168.2.3' >date.cron

[code]....

View 4 Replies View Related

Ubuntu :: Cron Runs Shell Script - But Only First Line Of It?

May 18, 2010

I have a cron job that runs a shell script. But it only runs the first line of that shell script and not the rest of the file. I'm a little stumped as to why. If I run the shell script manually, it runs and executes every single line as it should. I think I must need some additional syntax to make this run correctly?

Here is the crontab ...

Code:
root@kchlinux:~/macs# crontab -l
# m h dom mon dow command

[code]....

View 2 Replies View Related

Ubuntu :: Timestamp Format - Shell Versus Cron Job

Jun 16, 2010

Setup: 10.04 server with "bash" as /bin/sh
When I run "ls -l" in a shell I get the following format:

Code:
-rw-r----- 1 syslog adm 0 2010-06-13 06:53 /var/log/user.log
Whereas if "ls -l" executes from a cron job the format is:

Code:
-rw-r----- 1 syslog adm 0 Jun 13 06:53 /var/log/user.log
Notice the different time format. Now I could fix this by changing the cron job to

Code:
ls -l --time-style=+%Y-%m-%d %H:%M ...
but I'm interested in knowing why this behavior occurs. What's different between the cron job and the shell?

View 1 Replies View Related

Ubuntu Servers :: Getting My Shell Script To Run On Cron.daily?

Sep 30, 2010

My backup script works fine after some effort to get it where I wanted it. So the script is fine when I run it.

sudo bash backup.sh

now I have a sym-link to /etc/cron.daily but I do not see any new backups

View 9 Replies View Related

Ubuntu :: Creating Shell Script From Source Code For Cron?

Jan 31, 2010

This is regarding the KDE application Basket:

I want to create a shell script that I can run as a cron job to do automated backups. how to proceed. I have the source code and have pulled out the backup source files. Here is the link for the source code. The download is at the bottom of this page. The backup files can be found in the src folder listed as backup.cpp and backup.h [URL]

If someone can do this, I believe it will make a nice addition to the Basket application for all.

Also I am not running Kubuntu I am running Karmic 9.10 64 bit

View 8 Replies View Related

General :: Running Shell Scripts With Cron

Sep 24, 2009

I've been having a bit of trouble running a shell script with cron. A friend of mine does a community radio show and the station has a live stream but no podcasts, so I've set up a script to record the stream and encode it as an mp3 while I'm away using mplayer and lame -that's what I'm trying to do anyway.

Here's the script, but it doesn't seem to run- at least, I don't see any of the files it should be outputing, would they be in the cron.weekly directory (where I have the script) or in my home directory?

#This is a script to record 'The Unnamed Show'

#it will record the show from the live stream, then convert the output #to an MP3

#Finally, it will delete any files no longer required HOME=/home/byron/

View 2 Replies View Related

Software :: Running A Shell Script From Cron ?

Jul 1, 2010

Im having some difficulties with running a shell script from cron which I am unable to resolve for almost 2 days now.

For testing purposes, im trying this with simple shell script test.sh with chmod 777

This script is located at /var
When I type /var/test.sh it runs perfectly and prints asdasdasd
When I type /var/test.sh > /home/log it writes asdasdasd to /home/log - works

The problem occurs whenever I add it as a cron job to var/spool/cron/crontab/root

There is: 11 10 * * * /var/test.sh > /home/log - however, at 10:11 there is no file at /home/log

Cron as a service works, forexample, every day at 4 am it makes this backup sshpass -p xxxx rsync -avz -e ssh root@x.x.10.7:/data/backup/ /home/backups/isp_admin

However,

doesnt makes the folder

Where is the catch?

View 3 Replies View Related

Programming :: Running Shell Script Using Cron Job

Jul 8, 2011

I am using Shell Script to run my Java program. I have written a Cron job to invoke Shell Script every day at 7pm. Cron job is running every day at 7pm ,but it is not invoking my shellscript and also I am not getting any error message. I am able to run same shell script from cmd propmt using bash, and also I am able to invoke the same script from mainframes Universal command job. Same ShellScript and Same cronjob is working fine in my Dev server. But in my QA server it is not working.

View 7 Replies View Related

Ubuntu :: Script Fails In Cron But Runs Fine In Regular Shell?

Jul 11, 2011

I have an Ubuntu server running Couch Potato, Sick Beard and Sabnzbdplus. Everything "works" pretty well in a sense that CP and SB push the NZB's to Sabnzbdplus, but Sab crashes regularly (haven't found the solution or the cause for this problem, so if you have some advice regarding that, it's welcome).To counter this problem (Sab crashing) I have a script written which checks if Sab is runnning and if it isn't start it:

Code:
bart@Pyro:~$ cat CheckSabRunning.sh
#!/bin/sh

[code]....

View 9 Replies View Related

Fedora :: How Will More Than One Shell Script Cron - Weekly Work

Nov 23, 2010

What would happen if I place more than one shell script in the cron.weekly directory. would they run at the same time?

View 1 Replies View Related

Ubuntu :: Cron Job Not Working?

Oct 30, 2010

After I create a cron job to shred some documents it seems to start and then immediately stop. What am I doing wrong? For instance, here is my cron:

#!/bin/sh
DISPLAY=:0.0
PATH = /usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:

[code]....

View 2 Replies View Related

Ubuntu Servers :: Cron Isn't Working

Jun 18, 2011

I'm trying to remotely schedule a shutdown using cron but I can't get it to work. I did setup the following 'sudo crontab -e'

Code:

For some reason doesn't this work, since I was able to login and get this output when using 'date'

Code:

View 7 Replies View Related

Ubuntu :: Setting Up Cron For The First Time Not Working?

Aug 17, 2010

I've read a lot on how to setup a task in crontab. I think I understand how to edit the file, but when I try to save the changes, it says "no crontab for xxx." Then it says that it cannot create a new crontab. I have ubuntu desktop 9 running as a webserver. I've read the details in these posts and it isn't helping.

[URL]

View 3 Replies View Related

Server :: Cron Job Not Working?

Jun 1, 2011

I have a cron job to run every 15 minutes. The cron job is running per /var/log/cron. It lists the job every 15 minutes.

[Code]...

I do not see any errors. I also looked in /var/log/messages for any errors and it does not list any. I added a line to the script that is running to send an email to me to see if it is running or not. When I run the script from the command line, the script runs without error and I get an email. I have searched and can not find what it going on. Is there some where else errors might be? Could there be a permission issue? The cron job is not being added by the root user.

View 14 Replies View Related

Slackware :: Cron Job Not Working?

Nov 13, 2010

I set up a job in my crontab file to clear the /tmp file on bootup with the following line:

Code:
@reboot rm-rf /tmp/*
My /tmp folder is not clearing. I've never used cron before;

View 7 Replies View Related

Ubuntu Servers :: Cron Jobs At Reboot Not Working

Jul 13, 2010

Have a headless server running Lucid 64 bit. Everything is working great except for a couple of Cron jos I'm trying to have run at boot.

My user crontab looks like this:
# m h dom mon dow command
01 * * * * /home/ceallred/Scripts/SambaBkup.sh
@reboot /usr/bin/SpiderOak --headless &The SambaBkup script works like clockwork...

The SpiderOak job doesn't start. It works if I type the command in manually.
syslog only shows:Jul 13 22:45:33 RavenWing cron[1010]: (CRON) INFO (pidfile fd = 3)
Jul 13 22:45:33 RavenWing cron[1022]: (CRON) STARTUP (fork ok)
Jul 13 22:45:33 RavenWing cron[1022]: (CRON) INFO (Running @reboot jobs)
Jul 13 22:45:33 RavenWing CRON[1048]: (ceallred) CMD (/usr/bin/SpiderOak --headless &)Yet ps -A doesn't show a running SpiderOak process. It shows after starting manually.

View 7 Replies View Related

Ubuntu :: Cron Or Scheduled Tasks Not Working Properly

May 23, 2011

I am running a series of operations on executable matlab scripts which are connecting python and fortran scripts. I schedule the executables in cron. The problem:

- My original matlab scripts work perfectly.
- My executables work perfectly if I run them from the terminal. - Using the gui scheduled tasks and running the scripts once from a button, everything also works fine.
- But when I leave the scheduled tasks run on their own, I get an error! The error can be that the script hangs in general (I have some text logs exported every step to track the progress), or I get an error which never appears when I run the script with any of the other mentioned ways.
- I tried both cron command prompt or the GUI scheduled tasks
- I am running on Ubuntu 64 bit

View 3 Replies View Related

Debian :: Cron Task Not Working

Jun 27, 2015

I have a ts3.desktop file in my /usr/share/applications folder that I want to run on system boot. I have typed the following commands which don't work

Code: Select allcrontab -e

Then in the editor, I typed the following line at the bottom of file. I also made the necessary carriage return after this line.

Code: Select all@reboot gtk-launch ts3 /usr/share/applications

Then I pressed ctrl+o to save it.

After I put these commands in, I did the following command to troubleshooting this issue, see below.

Code: Select all$ crontab -l
no crontab for server
$ps -ef | grep cron | grep -v grep
root         532      1   0 21:35 ?                 00:00:00 /usr/sbin/cron -f

But after I reboot and nothing happens, the application doesn't start.

View 1 Replies View Related

Software :: Cron Not Working Under Cygwin ?

Jun 29, 2010

I'm running cygwin 1.7 on a vanilla win2k3 r2 server. I've put together a simple crontab that I'll paste in her in a sec. The crontab entries call several shell scripts that do either scp's or rsync's from linux servers to this win2k3 box under cygwin.

The problem is that the scripts work and run fine from the commandline. Just not when called from the crontab. I'm running from the root equivalent administrator UID. The crontab log files are empty of errors.

crontab is:

Like I said, the scripts execute fine from the command line.

View 3 Replies View Related

Ubuntu :: Cron Not Working - Attempting To Schedule A Task To Run Every Hour?

Oct 1, 2010

I am attempting to schedule a task to run every hour. I have altered the crontabs for my account but the the task still won't run on the hour.

View 1 Replies View Related

General :: Scheduled Cron Job Stpped Working

Aug 22, 2011

I run a Fedora 9 server at home, to host an "old school" MOO.To back up the database, I scheduled a cron job - and got some help with the script.I don't fiddle with stuff on the server much, because I don't really have a clue - leave well enough alone.But now I'm without backups. (I'd prefer to get this working, as it seemed pretty simple, and worked well for so long).

View 14 Replies View Related

General :: Ruby On Rails - Cron Job Not Working

Oct 5, 2010

It is little weird now that cron job is not working as i have set. I have set weekly job to send email but i am receiving multiple emails daily. Below is my code; # sends email every monday at 4:00 am 00 04 * * 1 /usr/bin/ruby /home/mbm/www/current/script/runner /home/mbm/www/current/app/models/add_to_delayed_job.rb -e production

00 -> Minutes
04 -> Hours (0-24)
1 -> Days / 0-6 / Sun - Sat

Sending email is fine but the time is not working so far as set.

View 2 Replies View Related

General :: How To Make Growisofs Working With Cron

Aug 9, 2010

I make a script to automate burning backup files on dvd. It works fine if I start it from root user, but if I start it. From cronjob do noting. I try on growisofs the option -use-the-force-luke=force but nothing happens. I check the env of cron:

HOME=/root
LOGNAME=root
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
PWD=/root
SHELL=/bin/bash
SHLVL=1
XDG_SESSION_COOKIE=3e0d70f7b71074a0b1fff4bb4aa97d13-1281297181.926502-724038309
_=/usr/bin/env
and it seems ok i've got my script in /usr/local/bin and growisofs in /usr/bin

Code of my script below:
#!/bin/bash
bkup_path='/bkrepo/';
prefix='PAR*';
totdimfile=0
for FILE in $(/bin/ls -r $bkup_path$prefix)

do
dimfile=`/bin/ls -l $FILE | /usr/bin/awk -F " " '{print $5}' `
let "totdimfile += dimfile";
if [ "$totdimfile" -lt "4700000000" ]
then
NAMEFILE=`/bin/ls -l $FILE | /usr/bin/awk -F " " '{print $8}' `
ALLNAMEFILE="$ALLNAMEFILE $NAMEFILE";
fi
done

/usr/bin/growisofs -use-the-force-luke=force -Z /dev/scd0 -R -J $ALLNAMEFILE
/usr/bin/growisofs -M /dev/scd0=/dev/zero
/usr/bin/eject
end code of my script

View 1 Replies View Related

General :: How To Schedule Job Using Cron That Shouldn't Run Between Working Hrs?

Aug 12, 2010

How to schedule a job using cron that shouldn't run between working hrs 9am-5pm, while run in non working hrs every hour, every day of the month, month & week.I tried the following way, not sure I can use logical not operator(!).

View 3 Replies View Related

General :: Scheduled Tasks / Cron Not Working Right?

May 23, 2011

Got a small problem, I'm trying to schedule a script to run every Thursday at midday and the scheduled tasks application on Ubuntu doesn't seem to work. The script is fine when I run it from a terminal.I have zero experience using cron at the command line, can anyone tell me what I should do?

View 2 Replies View Related

General :: Cron Not Working / Updating Opensuse 11.0

May 4, 2010

I am new to Linux and have done an install of Moodle 1.9.8 on Linux OpenSuse 11.0

I have created my cron via the terminal (crontab -e) root crontab - see below:

When going to /var/log/messages my cron entries appear as they should but my backup does not run and every morning when I go to the Notifications tab it tells me my crom maintenance script has not run in 24hours.

I would also like to get this in a log file and emailed to me.

View 2 Replies View Related

General :: Crontab(systemwide Cron) Not Working?

Apr 26, 2011

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command

[code]...

View 7 Replies View Related

Ubuntu :: Suddenly Init Smashed - Cron Not Working - Services Not Starting - Vpn Odd

Oct 25, 2010

I installed an LAMP Server on 10.10. Additionally a simple Sambaserver and a VPN is integrated. Since 3 days I look at some strange behaviour:

Code: sudo init 6 does not take effect. Nothing happens. Code: sudo reboot is working, but all seems to be so ropy. It takes a significant while, before ssh-session is finally terminated. After the system comes up again, the vpn-client gets not the same IP-address by DHCP-server, but the next following of dhcp-range. That is strange, because no other dhcp-client is busy. After a second reboot I get the correct first IP-address of the dhcp-range. That is reproducible.

cron is not working any more. None of my jobs is being triggered. Nothing is logged in /var/log/syslog any more. Services (apache2, mysql, smbd) are not running at the start. I have to run them up manually. Seems like init is somehow smashed? What is your guess? What futher information do I have to provide for analysis?

View 2 Replies View Related







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