Help with cron job

Since I'm stupid apparently:

I gave up on trying to use the default crontab that SLES uses (a little
too complicated, IMO) and just did a:

crontab -u root -e

I have a single script I need to run at 6:00 p.m. every night

So I did this:

0 18 * * * ./root/edirbackup.sh

It runs fine manually but doesn't appear to be running with cron.  Cron
is active.

I'm sure it's some stupid thing I'm doing wrong.

I've got myself ordered some SLES 10 training books, but in the
meantime if someone doesn't mind pointing out the error of my ways.

:)


-- 
kjhurni
------------------------------------------------------------------------



0
kjhurni
5/27/2009 6:16:03 PM
novell.sles.configure 3559 articles. 0 followers. Follow

7 Replies
506 Views

Similar Articles

[PageSpeed] 3

Is ./root intentional?  Try removing that dot.



kjhurni wrote:
> Since I'm stupid apparently:
> 
> I gave up on trying to use the default crontab that SLES uses (a little
> too complicated, IMO) and just did a:
> 
> crontab -u root -e
> 
> I have a single script I need to run at 6:00 p.m. every night
> 
> So I did this:
> 
> 0 18 * * * ./root/edirbackup.sh
> 
> It runs fine manually but doesn't appear to be running with cron.  Cron
> is active.
> 
> I'm sure it's some stupid thing I'm doing wrong.
> 
> I've got myself ordered some SLES 10 training books, but in the
> meantime if someone doesn't mind pointing out the error of my ways.
> 
> :)
> 
> 
0
Denis
5/27/2009 6:33:10 PM
It was in the sense that I thought in order to run a shell script you
had to use the "."
ie:

./install.sh

or something

Does it work differently if executing via cron than if you were typing
it at the console?


-- 
kjhurni
------------------------------------------------------------------------
kjhurni's Profile: http://forums.novell.com/member.php?userid=734
View this thread: http://forums.novell.com/showthread.php?t=374147

0
kjhurni
5/27/2009 7:26:02 PM
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Cron does not have much environment so there is no way for it to know
where to start to run './'.  './' just means "from here run this next
command".  If you are not "here" then there is no command to run.  With
cron always use absolute paths.

Good luck.





kjhurni wrote:
> It was in the sense that I thought in order to run a shell script you
> had to use the "."
> ie:
> 
> ./install.sh
> 
> or something
> 
> Does it work differently if executing via cron than if you were typing
> it at the console?
> 
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQIcBAEBAgAGBQJKHZYfAAoJEF+XTK08PnB5VS8QAMWdPM2dj4dNTD3F9tWNqtWW
YQv8tALonoA3a2ASjfL2hvw68k544/kaLfqD2jRjEiWInl0Hs/RXewEH76XY/ikH
v4asCq610ursQr8VT8oqX2hZABhqKC7Hsx5/SG6+PDpZCP9hNKkvogfMssSWhmv3
p7zsqqGezecMTUpczlS3lig29Suxei1NqQ29YnCEOm4ODUIE9ewzSSJ24TrUnoXY
zi6BfYSgkDKAcU/ZDTCDXVppU0RcgQiWbo7UWSLHSb0mXhHqVWP3L/TnSlDew/Rk
twXMuiQ/wQSeb64iHfWAIIpWM8Uv+5VOPY484qt8q4woRhq3nHaEnG0VKnZonSW5
zEIxIyjrxX91YodOAX3OMjE4e6pdQYWnDMYkaYTYGCEfqsFaLpow6aVx0oWxp7me
X4ypRC1IVq+62wfGo/gVLLwf4wgqev0zCI4x+/RAhHc6ss+L2VLbAQz6KzBJi21s
Inet4RiP8F/pi0KDDoPJXeeVMUQJV0ShbZdxT/AFjpVCNOs0z1bbpevF8NeOcfAX
b6j/YqHfXxyWxE58vobHXdRbSjY/u26GBupwjeuVTkUxhwbJ21EBO/aqPWBVnuTC
ndHFEVxH2qnlShLwpWygeIdOXHskeIRyCcuDIDvHKSCitBq03hNts/iD3wkDFAAb
bmx50iibvVKTeomDg9vg
=WhXn
-----END PGP SIGNATURE-----
0
ab
5/27/2009 7:36:00 PM
You may also consider having the script write a time/date stamp into a
log file to see if the script is being called at all or if the script is
being called but not executing properly.


-- 
utman
------------------------------------------------------------------------
utman's Profile: http://forums.novell.com/member.php?userid=5893
View this thread: http://forums.novell.com/showthread.php?t=374147

0
utman
6/1/2009 9:06:02 PM
utman;1800558 Wrote: 
> You may also consider having the script write a time/date stamp into a
> log file to see if the script is being called at all or if the script is
> being called but not executing properly.

Just to make sure:

If you're running a script from terminal, you need to use:

./script.sh

But if you're calling from a CRON job, you do NOT use the "." and use
absolute paths:

(ie:

/root/script.sh)

Anyway, here's what my crontab looks like for root:

0 18 * * * /root/edirbackup.sh


Here's the script:

#!/bin/bash
cd ~
rm edirbackup.bk
dsbk backup -b -f /root/edirbackup.bk -l /root/edirbackup.log



So you're saying I should (at line 2) put something in to write a log
file like a touch command or something?


-- 
kjhurni
------------------------------------------------------------------------
kjhurni's Profile: http://forums.novell.com/member.php?userid=734
View this thread: http://forums.novell.com/showthread.php?t=374147

0
kjhurni
6/2/2009 9:26:01 PM
Well, /var/log/messages SAYS it's running the cronjob:

Jun  2 18:00:01 server3 /usr/sbin/cron[30668]: (root) CMD
(/root/edirbackup.sh)

But from there it doesn't seem to be actually running (I imagine if
there was an error it would be logged somewhere?)


-- 
kjhurni
------------------------------------------------------------------------
kjhurni's Profile: http://forums.novell.com/member.php?userid=734
View this thread: http://forums.novell.com/showthread.php?t=374147

0
kjhurni
6/3/2009 3:06:03 PM
Figured it out.

It can't find dsbk

I put a line for redirecting the output of the cronjob:

0 18 * * * /root/edirbackup.sh > cronlog.log 2>%1


-- 
kjhurni
------------------------------------------------------------------------
kjhurni's Profile: http://forums.novell.com/member.php?userid=734
View this thread: http://forums.novell.com/showthread.php?t=374147

0
kjhurni
6/3/2009 3:36:02 PM
Reply:

Similar Artilces:

HELP!HELP!HELP!HELP!HELP!HELP!
I was using powerbuilder4.0 a month ago I decided that migrate it to PB7.0 When Im using 4.0, in datawindows I was using extra colums additional to stores procedure. I mean that for example; stored proc. returns 4 columns. I was using 2 extra columns to modify something from client. But I cant do the same thing in PB7.0. How can I do that??? please help. Gurcan yucel gyucel@infina.com.tr "I was using 2 extra columns to modify something from client." what does this mean that you added to the result set? If so then just goto the SQL and add a param. Then set the...

Help Help Help Help Help Help
------=_NextPart_000_0074_01C2960E.EBE13A30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Can someone please help me. I have installed mysql on Unix Solaris and it works fine I have Perl installed previously which is working and with which i have installed other perlmodules before and are working fine. I have also installed DBI and it works fine with the Sybase drivers which i have installed. When i tried to install the Msql-Mysql-modules-1.2219 drivers i get the following error. # make /usr/local/bin/perl -Iblib/arch -Iblib/lib -I/...

Help Help Help Help
i need to create a crosstab report using Crystal reprot for VS 2003 i face aproblem when i need to order my Fileds by their names my data must be like this Basic Cola Housing Gross Deduction1 Deduction2 Deduction3 Net but when i run my report it give my a not sorted data acutally i have acode field which can i order field using it. but i don't knwo how to do thisSo..................? Select Report tab | |-->Select Record Sort expert Choost the fields you want to sort --Select the corresponding sort direction f...

help help help help
Name: chef mario Email: chefusa_at_pacbell.net Product: Firefox Summary: help help help help Comments: Heard great reports about Firefox!!! Downloaded & installed Firefox !!!! Lost All my very very valuable BOOKMARKS!!! CAN ANYONE HELP!!!!! All bookmarks were in Internet Explorer Did bookmark transfer to Firefox. Seem the Fox eat all m,y bookmarks Need serious help anyone. chef mario Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8) Gecko/20051025 Firefox/1.5 ...

Help with Script/Cron job
Recently set up external USB drives for backup-to-disk with latest version of Backup Exec (9.2?) for Netware OES 6.5 server. Backup jobs run great so far but I would like to automate the process of deactivating the pool and then dismounting the volume at the end of the week so my client can then just plug in the 2nd USB drive (same Volume and Pool name) for the next week of back up jobs. Anyone out there have any pointers or resources for doing so? TIA, Ben Ben Lewis, So do you want this to pre-executed before the backup job starts or do you wanna have it like a comma...

SLES 11 Cron jobs
SLES 11 now uses a run-crons script in the crontab file which runs every 15 minutes and checks the normal cron.daily etc folders. I need to run a script every 5 minutes. I've add a line about the run-crons to run a script every 5 minutes but it is not firing. What is the proper procedure for this in SLES 11? -- mww ------------------------------------------------------------------------ -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 If it is for your own user just edit your own crontab. If it is for the root user edit that user's crontab or the system cr...

help me How to configure sles 10 as PDC
Hi would you please help in this, I tried to configure my SLES 10 to become PDC using samba with or without ldap , and I used the manuals came with the SLES 10, but they are not useful. and the result is the same, when I tried to join windows to the domain, a user not found msg appeared, however, when I started rcsmb and rcnmb the /var/log/samba/log.nmbd log shows that the samba server was acting as Domain Master Browser for seconds and then local master browser and log.smbd shows no errors. can you give me a howto guide to implement samba on SLES 10 as PDC ??? -- d...

HELP!!!HELP!!!HELP!!!
I try set picture to database and import it to picture control. Why SetPicture funktio dosen�t work? blob b, tot_b integer li_FileNum, loops, i, ret long flen, bytes_read, new_pos string txtname, named string defext = "BMP", Filter = "bitmap Files (*.bmp), *.bmp" ret = GetFileOpenName("Open Bitmap", txtname, named, defext, filter) SetPointer(HourGlass!) flen = FileLength(txtname) li_FileNum = FileOpen(txtname, StreamMode!, Read!, LockRead!) IF flen > 32765 THEN IF Mod(flen, 32765) = 0 THEN loops = flen/32765 ELSE loops = (flen/32765...

HELP HELP HELP
I need EAS 3.0.1 mantainance as soon as possible or at least an updated datawindow.jar. I've already asked the mantainance CD to italian Sybase support but they know nothing about it. If someone from sybase could send me an updated datawindow.jar would be very very appreciated. Please email me to m.mazza@ads.it Thank you Mauro Mazza Research & Develop - Gruppo FINMATICA E-mail: m.mazza@ads.it http://www.ads.it ADS automated data systems - Data Processing S.p.A. Via Del Lavoro, 17 40127 Bologna - Italy tel. +39 051 6307 411 fax. +39 051 6307 498 We expect t...

help help help
after i unload., theni install adaptaive server.......everythings running well but unluckily it cannot start the adaptive server when installing but backupserver and XP server can install and start it Building Adaptive Server "abc", unable to boot server "abc" server "abc" was not connected anyone can help me Was an errorlog created for this ASE in the ASE install directory? If so, what does it say? Zidane wrote: > after i unload., theni install adaptaive server.......everythings running > well > but unluckily it cannot st...

Help!help!help!
Whether can I set a window to be unmoveable when the application is run,whatever the window is normal or max when it's running?If it may be set,how.... ...

help! help! help!
I got such errors while installing a new replication server,please help me !Thanks a lot. T. 2003/05/29 14:21:24. (-1): Hardware Exception: c0000005, EXCEPTION_ACCESS_VIOLATION T. 2003/05/29 14:21:24. (-1): Thread GLOBAL RS(GLOBAL RS) infected with signal -1073741819 T. 2003/05/29 14:21:24. (-1): ***************STACK TRACE*************** T. 2003/05/29 14:21:24. (-1): *****thread GLOBAL RS(GLOBAL RS)******* T. 2003/05/29 14:21:24. (-1): unknown function 0x0038c559 () T. 2003/05/29 14:21:24. (-1): unknown function 0x0038bb65 () T. 2003/05/29 14:21:24. (-1): pc: 0x00468934, err_h...

help!help!help!
Sorry to re-post again, Hi, Dean : 1. Are you dialing an ISP or dialing modem pool in side the company? I am dailing an ISP. Because some of my client use this way. 2. Is the Jag server behind a firewall? No, there is no Firwall. 3. Do you have a proxy for the remote component? Yes. 4. What is the syntax of createinstance? ls_class = "p_packagename/n_cst_logon" if not isvalid(inv_logon) then ll_return = g_connect.CreateInstance(inv_logon,ls_class) if ll_return <> 0 then ls_return = ...

HELP HELP HELP
Hi again: Just tested my first test and proceeded to test and install a second time. This time I let the server run the update after registering with Novell. However, upon reboot the server was dorked as it could not read my /usr and /var partitions (fstab was bad). Now here is what changed between my first the second build: I added a separate partition for /usr, that is all. I could really use a hand here. If I can't trust the update mechanism ...... Chris. Chris wrote: > Hi again: Just tested my first test and proceeded to test > and install a second...

Web resources about - Help with cron job - novell.sles.configure

Help - Wikipedia, the free encyclopedia
United States Senate Committee on Health, Education, Labor and Pensions , commonly abbreviated "H.E.L.P." Text is available under the Creative ...

Help:Contents - Wikipedia, the free encyclopedia
Templates are special pages that contain boilerplate text intended to be displayed on more than one page in Wikipedia. This Tip of the day box ...

Amusement Park Helps Premiere Socially Relevant Music Video on MLK Day
For Martin Luther King Jr. Day, Amusement Park is working with National Basketball League All-Star Damian Lillard to premiere his latest music ...

Your budgeting is easier and better with the help of monthly
... their money better, budgeting different expenses and promising to save money for unexpected problems or expenditures. Using an app can help ...

Giant icebergs help the Southern Ocean soak up carbon
(credit: Patrick Rowe, NSF ) The natural movement of carbon through the Earth and its inhabitants is essential to life as we know it. Carbon ...

Pet Help
I do not want to get a bark collar, but I have got to do something about Thurston’s barking. It is NONSTOP. I am at my wit’s end.

J.K Rowling reveals the secret she told Alan Rickman to help him understand Snape
In 2011, following the release of the eighth and final Harry Potter film, Alan Rickman conducted a phone interview with Hitfix . Among other ...

GRAVITAS: Can Mr. Trump’s Supporters Help Me Understand His 24-hour, 180˚ Turnabout Over the Weekend ...
After months of complimenting his rival for the GOP nomination, Senator Ted Cruz, Donald Trump engaged in a weekend of diatribes, insults and ...

Republican Operatives Try to Help Bernie Sanders
Washington Post Republican Operatives Try to Help Bernie Sanders Bloomberg Democratic presidential candidate Bernie Sanders participates in ...

A Bristol startup has raised £7.7 million for its cloud software that helps retailers keep their businesses ...
Bristol startup Brightpearl has raised £7.7 million ($11 million) for its cloud management software that helps retailers manage their businesses. ...

Resources last updated: 1/19/2016 6:40:34 PM