LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-09-2009, 10:56 AM   #1
abhijeetdutta
Member
 
Registered: Aug 2009
Posts: 139

Rep: Reputation: 16
ftp script


hi i am very much new on script.please do some modification on below script.


========================================================================

#!/bin/bash
cd /usr/sap/GD0/put/MKData
f_dir=`pwd`
f_date=`date --date="today" +%F | sed 's/-//g'`
f_name=mkdenialsapextended_delta$f_date.xml
f_host='ftp.abhi.com'
f_user='mkob'
f_passwd='2m'

ftp -n -v $f_host << FTP_EOF
user $f_user $f_passwd
bin
prompt
get $f_name
bye
FTP_EOF
====================================================================
modification which should be needed...on above script
======================================================================

1. AbhiData does not have updates after 8:00PM everyday. That is why script should run at 9:00 PM everyday and look for any delta file.
2. Download the new file from AbhiData to a temporary directory. The original file (which will be downloaded manually) is abhidenialSAPExtended.xml.zip but subsequent files will have a date stamp (ex: abhidenialsapextended_delta20080123.xml). The script should send an email alert if something goes wrong with the download (ex: can’t connect to FTP server, space issues, etc). Notes:
o AbhiData does not prepare new files every day so there will be days when there is no new file. If there is no new file then the script should end here without sending an email alert.
o The original mkdenialSAPExtended.xml.zip file will be loaded manually and does not need to be included in the script.
3. Copy the file from the temporary directory to the “in” directory renamed as “abhidenialsapextended.xml”. This should overwrite the existing “abhidenialsapextended.xml” file. There should always be a “abhidenialsapextended.xml” file in the in directory so the SAP batch job will not error out.
4. Move the file from the temporary directory to the “done” directory.
5. Weekly, a compare should be done between the files in the “done” directory and the files on the abhiData server to make sure that no files are missing (files from MKData are “delta” loads – any missing files means our lists will be incomplete). An email alert would be sufficient – any missing files can be loaded manually.


Please do the needful.

Regards
Abhijeet
 
Old 09-09-2009, 02:01 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,899

Rep: Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262
Quote:
Originally Posted by abhijeetdutta View Post
hi i am very much new on script.please do some modification on below script.


====================================================================
modification which should be needed...on above script
======================================================================

1. AbhiData does not have updates after 8:00PM everyday. That is why script should run at 9:00 PM everyday and look for any delta file.
2. Download the new file from AbhiData to a temporary directory. The original file (which will be downloaded manually) is abhidenialSAPExtended.xml.zip but subsequent files will have a date stamp (ex: abhidenialsapextended_delta20080123.xml). The script should send an email alert if something goes wrong with the download (ex: can’t connect to FTP server, space issues, etc). Notes:
o AbhiData does not prepare new files every day so there will be days when there is no new file. If there is no new file then the script should end here without sending an email alert.
o The original mkdenialSAPExtended.xml.zip file will be loaded manually and does not need to be included in the script.
3. Copy the file from the temporary directory to the “in” directory renamed as “abhidenialsapextended.xml”. This should overwrite the existing “abhidenialsapextended.xml” file. There should always be a “abhidenialsapextended.xml” file in the in directory so the SAP batch job will not error out.
4. Move the file from the temporary directory to the “done” directory.
5. Weekly, a compare should be done between the files in the “done” directory and the files on the abhiData server to make sure that no files are missing (files from MKData are “delta” loads – any missing files means our lists will be incomplete). An email alert would be sufficient – any missing files can be loaded manually.


Please do the needful.

Regards
Abhijeet
Ok..I will "do the needful"...

Write your own programs. Google can point you to thousands of scripting tutorials, and if you get stuck on a particular problem, post it, and we can help you. However, I doubt anyone here is going to write programs for you, for free, to your custom specifications.

A hand up is always here...a hand OUT isn't.
 
Old 09-09-2009, 02:05 PM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Well said TB0ne, well said indeed, no more needfull things to add.
 
Old 09-09-2009, 02:10 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,899

Rep: Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262Reputation: 4262
Quote:
Originally Posted by EricTRA View Post
Well said TB0ne, well said indeed, no more needfull things to add.
And as an added bonus, he's either posted it under another name, or one of his co-workers posted the EXACT SAME QUESTION in another forum.
 
Old 09-09-2009, 02:12 PM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Well, at least he/they is/are doing an effort to find a solution, although IMHO, if they follow your advice (google) they will get it a lot faster.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP Script tommytomato Linux - General 28 07-14-2006 05:16 AM
FTP script the_imax General 6 12-30-2005 01:27 AM
Urgent Help: Perl FTP Script Using NET::FTP xboxter Programming 8 05-16-2005 06:57 PM
FTP script Veteq Programming 3 04-21-2004 12:32 PM
ftp script dlm4444 Linux - Networking 5 02-10-2004 11:41 PM


All times are GMT -5. The time now is 03:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration