Overclockers Australia Forums
OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Software Topics > Other Operating Systems

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 30th April 2010, 2:46 PM   #16
k371n
Member
 
k371n's Avatar
 
Join Date: Mar 2002
Location: melbourne
Posts: 761
Default

Quote:
Originally Posted by echelon6 View Post
Thanks, ok trying this now

so if I tell a process to redirect its shell output to a file that doesn't yet exist, linux will make the file for me?
Yes.
/tmp dir is already made.
$ ls -Fla /tmp
k_
__________________
I'm waiting for the night to fall, when everything is bearable
and there in the still, all that you feel is tranquillity - dm

k371n is offline   Reply With Quote

Join OCAU to remove this ad!
Old 3rd May 2010, 2:02 PM   #17
echelon6 Thread Starter
Member
 
Join Date: Sep 2006
Posts: 707
Default

Ok I confirmed cron works...

Implementing everything in its final form

fingers crossed

edit:

Ok cron is working, but when it finally runs, NOTHING gets downloaded. I also output my wget into a log file and while the log file gets successfully created, it is blank

my cron script is:

date=`date -I` ; wget -P /volume1/downloads ftp://USER:PASS@SITE.com.au/SITE.com.au_$date.tgz > /tmp/wgetLog

If I run the cron script by itself in the shell, it downloads the file perfectly. But when in crontab, it doesn't do anything except make a blank file called wgetLog



I'm sooo close to my solution, just need a bit more help, thanks
__________________
industrialist... philanthropist... bicyclist...

Last edited by echelon6; 3rd May 2010 at 3:37 PM.
echelon6 is offline   Reply With Quote
Old 4th May 2010, 11:28 AM   #18
k371n
Member
 
k371n's Avatar
 
Join Date: Mar 2002
Location: melbourne
Posts: 761
Default

Try this cron script:
Code:
(date=$(/bin/date -I) ; /usr/bin/wget -P /volume1/downloads ftp://USER:PASS@SITE.com.au/SITE.com.au_${date}.tgz > /tmp/wgetLog 2>&1)
One of the recommendations in an earlier post said to use full paths for your binaries.
k_

ps.
I tried a variant of the above and it worked with the following, optimised.
Code:
/usr/bin/wget -P /volume1/downloads ftp://USER:PASS@SITE.com.au/SITE.com.au_$(/bin/date -I).tgz > /tmp/wgetLog 2>&1
__________________
I'm waiting for the night to fall, when everything is bearable
and there in the still, all that you feel is tranquillity - dm


Last edited by k371n; 4th May 2010 at 11:45 AM.
k371n is offline   Reply With Quote
Old 4th May 2010, 11:39 AM   #19
cleary
Mental in the Face
 
cleary's Avatar
 
Join Date: Apr 2003
Location: Griffith NSW
Posts: 3,871
Default

Quote:
Originally Posted by echelon6 View Post
...
date=`date -I` ; wget -P /volume1/downloads ftp://USER:PASS@SITE.com.au/SITE.com.au_$date.tgz > /tmp/wgetLog

...
the date format you're using here is different to the one you specified initially too - are you sure it's correct?
__________________
SmugMug
cleary is offline   Reply With Quote
Old 4th May 2010, 12:57 PM   #20
bugayev
Whammy!
 
bugayev's Avatar
 
Join Date: May 2003
Location: Melbourne
Posts: 3,945
Default

Don't forget to specify the full path to date not just wget
__________________
Administrator: Apple Desktop Hardware/Software, Graphics and Programming, Digital Art, iOS Devices, For Sale (PC and Non-PC), Price Check and What/Where Should I Buy?
mercury: 11" Macbook Air, i5, 4Gb RAM, 128Gb SSD
lunchbox: Mac mini, i5 Dual Core, 4Gb RAM, 500Gb HDD
bugayev is offline   Reply With Quote
Old 4th May 2010, 5:31 PM   #21
echelon6 Thread Starter
Member
 
Join Date: Sep 2006
Posts: 707
Default

Quote:
Originally Posted by bugayev View Post
Don't forget to specify the full path to date not just wget
Yep bingo that did the trick

For some reason, commands in cron need to specify the full path of wget and date and other functions. once I did this, everything worked sweet

Thanks EVERYONE for all the help these last few days
__________________
industrialist... philanthropist... bicyclist...
echelon6 is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 6:42 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!