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
Forums
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
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
тАО04-19-2004 04:16 PM
тАО04-19-2004 04:16 PM
FTP
Now, I am facing problem where the files not successfully sent also will be deleted.
How can I modify my script so that it will check and delete only files that are successfully sent or how can I make sure the deleted files are "safe" in destination.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2004 04:40 PM
тАО04-19-2004 04:40 PM
Re: FTP
1. Create a ftpcopy directory somewhere at source.
2. Delete all files in ftpcopy directory.
3. Do the actual ftp.
4. After the ftp is over move the files to a ftpcopy directory instead of deleting.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2004 05:46 PM
тАО04-19-2004 05:46 PM
Re: FTP
There are threads here to find out how to capture ftp return codes . add them in the script . Please note most of them are using perl
Kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-19-2004 07:15 PM
тАО04-19-2004 07:15 PM
Re: FTP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2004 05:11 AM
тАО04-21-2004 05:11 AM
Re: FTP
that has a example on how to check transfer.
The attachment is a fragment of a working script.
The fragment should work
The basic scenerio is
ftp the stuff.
logout
ftp again and do a dir on the directory,
capturing the contents and checking it.
if ok I mail completion notice, You can remove file instead of mailing.
Another scenerio is loging back in getting the file puting it to an another file name and doing a compare. (This isn't very desirable because of the file size)
Hope this helps
Rory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2004 05:46 AM
тАО04-21-2004 05:46 AM
Re: FTP
if your using the Net:FTP module in perl
you could build an array of successful transfers or failed tranfers, then remove or not remove(depending on the list you created), the files in that list.
or you could call a perl script that returns 0 for success and non-zero for failures, and test each transfer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2004 05:59 AM
тАО04-21-2004 05:59 AM
Re: FTP
#!/usr/bin/perl
($host, $user, $pw, $file) = @ARGV;
use Net::FTP;
$ftp=Net::FTP->new("$host");
$ftp->login("$user","$pw");
$ftp->put("$file") && push @success, $file;
$ftp->quit;
foreach $file (@success) {
unlink $file;
}
exit 0;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-21-2004 06:07 AM
тАО04-21-2004 06:07 AM
Re: FTP
ftpput.pl -h remhost -l remuser -p passwd -A -d /dir1/dir2 -t 3 -r file1 file2 file3
STAT=${?}
echo "Status = ${STAT}"
Note that the -p passwd argument is optional if you setup a .netrc file (man netrc for details) so that the password does not have to be passed on the command line.
I spent about 3 minutes adding the -r option to an existing version. As each files is successfully put, the source file is removed.
Invoke as ftpput.pl -u for full usage.