Unix Technical Forum

FTP Script

This is a discussion on FTP Script within the AIX Operating System forums, part of the Unix Operating Systems category; --> I have a script which ftp some files which are created from our system every day with the end ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 06:15 AM
Antigoni
 
Posts: n/a
Default FTP Script

I have a script which ftp some files which are created from our system
every day with the end of day procedure.A part of the script is the
following:

#File
FILE_NAME=AF$(date +"%d%m%y").txt

more AFBTF001* AFBTF003_B* AFBTF004* AFBTF04B* AFBTF030* AFBTF035*
AFBTF047* AFBTF065* AFBTFADM* AFBTF066* AFBTFBRN* AFBTFUSR* >
$FILE_NAME

ftp -n $FTP_HOST<<END_SCRIPT
quote USER $FTP_USER
quote PASS $FTP_PASSWD
ascii
prompt off
cd $REMOTE_DIR
put $FILE_NAME

The files AFBTF001* AFBTF003_B* AFBTF004* AFBTF04B* AFBTF030*
AFBTF035* AFBTF047* AFBTF065* AFBTFADM* AFBTF066* AFBTFBRN* AFBTFUSR*
may be created before midnight or after.

I want someone to help me how to change my script so that in case the
files are created after midnight, not to take the next day´s date.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 06:16 AM
Piotr
 
Posts: n/a
Default Re: FTP Script

Hi,

you should modify the TZ when you use the date command.

For example, I have TZ=NFT-1DFT, if I want to know what time it was 12 hours
before, I juste have to use the following :

supaix51:root:/ > echo `TZ=NFT+11DFT date`

Thu Nov 25 08:35:40 NFT 2004

supaix51:root:/ > date

Thu Nov 25 20:35:43 NFT 2004



In fact, you just play with TZ... If you want to go back in time for N
hours, just add N to the offset of your normal TZ.

Of course, it works until noon



"Antigoni" <arodosthenous@laiki.com> a écrit dans le message de news:
5d90526b.0411242251.2eba55b9@posting.google.com...
> I have a script which ftp some files which are created from our system
> every day with the end of day procedure.A part of the script is the
> following:
>
> #File
> FILE_NAME=AF$(date +"%d%m%y").txt
>
> more AFBTF001* AFBTF003_B* AFBTF004* AFBTF04B* AFBTF030* AFBTF035*
> AFBTF047* AFBTF065* AFBTFADM* AFBTF066* AFBTFBRN* AFBTFUSR* >
> $FILE_NAME
>
> ftp -n $FTP_HOST<<END_SCRIPT
> quote USER $FTP_USER
> quote PASS $FTP_PASSWD
> ascii
> prompt off
> cd $REMOTE_DIR
> put $FILE_NAME
>
> The files AFBTF001* AFBTF003_B* AFBTF004* AFBTF04B* AFBTF030*
> AFBTF035* AFBTF047* AFBTF065* AFBTFADM* AFBTF066* AFBTFBRN* AFBTFUSR*
> may be created before midnight or after.
>
> I want someone to help me how to change my script so that in case the
> files are created after midnight, not to take the next day´s date.



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:37 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com