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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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. |
| ||||
| 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. |