Link to home
Start Free TrialLog in
Avatar of aot2002
aot2002

asked on

ncftp nice ftp using automated backup file

ncftp how can i use ncftp with a shell script ?
PLEASE SHOW AN EXAMPLE SMALL SCRIPT with -z option for autoresuming


ncftp -u server -p jackandjillpassword myhomeserver.com
put /root/websitebackup.tgz websitebackup.tgz
put /root/nameserverbackup.tgz nameserverbackup.tgz
put /root/mailstuffbackup.tgz mailstuffbackup.tgz
put -z /root/alldatabases.tgz alldatabases.tgz

ASKER CERTIFIED SOLUTION
Avatar of sigel1
sigel1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aot2002
aot2002

ASKER

im using this script but it only goes to the ftp login prompt and wont continue futher ?









#!/usr/bin/expect -f
#
set force_conservative 0  ;# set to 1 to force conservative mode even if
                          ;# script wasn't run conservatively originally
if {$force_conservative} {
        set send_slow {1 .001}
        proc send {ignore arg} {
                sleep .1
                exp_send -s -- $arg
        }
}
set timeout 6
puts "\n"
#
spawn ncftp -u linux -p test myspecialdomainathome.com
#spawn ftp localhost
expect "ncftp / >"
#send -- "\r"
#expect "Password:"
#send -- "barreiro@arrakis.es\r"
#expect -exact "ftp> "
#send -- "binary\r"
#expect -exact "ftp> "
#send -- "hash\r"
#expect -exact "ftp> "
#send -- "cd pub/spain/gnome\r"
#log_user 1
#expect -exact "ftp> "
#send -- "ls\r"


#send -- "put /root/webmin-1.130-1.noarch.rpm test.rpm"
#expect "could not open file"
#send -- "\r"

#send -- "put /root/websitebackup.tgz websitebackup.tgz"
#expect "could not open file"
#send -- "\r"

send -- "put /root/nameserverbackup.tgz nameserverbackup.tgz"
expect "could not open file"
send -- "\r"

send -- "put /root/mailstuffbackup.tgz mailstuffbackup.tgz"
expect "could not open file"
send -- "\r"

send -- "put -z /root/alldatabases.tgz alldatabases.tgz"
expect "could not open file"
send -- "\r"

send -- "put /root/all_logs.tgz all_logs.tgz"
expect "could not open file"
send -- "\r"

#puts "\n"
exit