- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- ftp script help
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2006 01:50 AM
тАО10-12-2006 01:50 AM
I am writing an ftp script for the first time .......
I am familiar with the syntax ie
ftp -v -i -n
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2006 02:14 AM
тАО10-12-2006 02:14 AM
Solutionthe way I see it:
1. To check you have all the info of the file, get a list of the directory you are ftping, then ftp the files and compare the size of the files against the dir listing.
That assumes you can't get the source system to generate an index file with checksum of all the individual files, which would act as a marker that all the files had been generated on the source - clear to start ftp.
You could then use the checksum file to compare checksums.
Header/trailer records could be an alternative.
2. use "get abc _abc"
then after comming out of the ftp part of the script move _abc to abc
What do you think ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2006 02:32 AM
тАО10-12-2006 02:32 AM
Re: ftp script help
the files are _abc when ftp puts to the windows box then rename _abc abc on the windows box so another program can then transfer to a server else where.
on the unix box then mv the abc to /archive.
I have an idea where I list the files on the unix server and create a files.lst.
files ftp over then ftp the files.lst then run a program on the windows server to xref _abc with files.lst.
once verified mv files within files.lst to archive.
a bit of a mess but we are using an sftp server for transfering data to a company not associated with the company I work for.
is there a way I can reference files.lst so to ftp the files in that list?
Chris.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2006 02:40 AM
тАО10-12-2006 02:40 AM
Re: ftp script help
best way for referencing is to do a dynamic ftp script:
echo "ftp -v -i -n
echo "username xxxxx xxxx" >>ftper.sh
# prefix each file with "get "
sed "1,$ s/^/get /" files.lst > files.dat
cat files.dat >> ftper.sh
echo "quit" >> ftper.sh
echo "!EOF" >> ftper.sh
chmod 777 ftper.sh
./ftper.sh
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2006 02:46 AM
тАО10-12-2006 02:46 AM
Re: ftp script help
Chris
<(+_+)>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2006 02:52 AM
тАО10-12-2006 02:52 AM
Re: ftp script help
sed "1,$ s/^/get /" files.lst > files.dat
the "1,$" mean? I get the s/^ is the start of the line - does it mean from beginning to end of file?
cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2006 02:56 AM
тАО10-12-2006 02:56 AM
Re: ftp script help
yes, 1 to last line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-12-2006 10:56 AM
тАО10-12-2006 10:56 AM
Re: ftp script help
You should probably remove it since that's the default. And you would probably understand it better. :-) (For vi/ex, you can use % for that.)