Results 1 to 10 of 10

Thread: Ftp Script

  1. #1
    Join Date
    Feb 2004
    Posts
    9

    Red face Unanswered: Ftp Script

    I am using a script to automatically download my incremental backups to my backup server. I have created a script which is executed after every 40 minutes in order to update the backup server. I used ftp "ftp -n" for this purpose. Facing a problem that if the link between backup server is not available or there is any problem with file dumping at backup server - I cannot catch the exceptions - I mean error codes. FTP Always returns 0 (successful) even the Backup server is not available. Is there any remedy for that?

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    You could try and 'ping' the server first
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  3. #3
    Join Date
    Feb 2004
    Posts
    9

    Wink Ping

    the ping is a good solution if you want to check the availability of the server - fine - but what happened when there is some break in connection b/w these two servers?

    I am exactly looking at EXIT STATUS solution - which could help me to sort out.

    Thanks anyway !

  4. #4
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Quote Originally Posted by tahirkhalil
    the ping is a good solution if you want to check the availability of the server - fine - but what happened when there is some break in connection b/w these two servers?

    I am exactly looking at EXIT STATUS solution - which could help me to sort out.

    Thanks anyway !
    Unfortunately there is no EXIT STATUS solution, you may have to re-direct the ftp output to a log file and then 'grep' this file for errors.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  5. #5
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    Quote Originally Posted by LKBrwn_DBA

    Unfortunately there is no EXIT STATUS solution, you may have to re-direct the ftp output to a log file and then 'grep' this file for errors.
    and also as a FYI:
    http://www.ftpplanet.com/ftpresources/ftp_codes.htm
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  6. #6
    Join Date
    Dec 2004
    Posts
    1

    Exclamation Using ftp libraries!

    hi,
    I had the same problem and I have a different solution for the same!
    You can use ftp library files available in the net, so that you can automate ftp in c and monitor the return status of every get/put commands.

    I downloaded the one from the following link:
    http://www.linuxsoft.cz/en/sw_detail...m=3449#diskuze

    Thanks,
    vijayakumar

  7. #7
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Cool

    Or, if you do not want to program, you could use expect.
    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

  8. #8
    Join Date
    Jun 2004
    Posts
    2

    Ftp

    Hi,

    I have a FTP program that I can connect to with users and gropus and that set up. Is there a script on the net that I can intergrate into my website to log into the server?

    Thanks,
    Beefa

  9. #9
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  10. #10
    Join Date
    Jan 2005
    Location
    India
    Posts
    6
    One of my friend suggested me the following perl

    #!/usr/bin/perl
    use Net::FTP;
    $ftp=Net::FTP->new("$hostname");
    $ftp->login("$user","$password");
    $ftp->get("$file") or die "Oh dear file didn't come over properly\n";
    $ftp->quit;
    exit 0;

    Kaps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •