Hello,
I am trying to create a script which will backup all my data to a remote ftp server
I need to tar all folders inside /data separately /data/as - /data/as/001 - /data/as/002 - /data/as/003 /data/as/004 - etc etc
[code]for dir in */; do dir=`echo $dir | tr -d '/'`; echo $dir; tar czf $dir.tar.gz $dir; done[/code]
the above code works fine but only if I run it from inside each directory - so how can I tar all folders inside the /data folder and put the tar files into a different folder with the original name of the folders?
ftp script
[code]
#!/bin/sh
USERNAME="your-ftp-user-name"
PASSWORD="your-ftp-password"
SERVER="your-ftp.server.com"
# local directory to pickup *.tar.gz file
FILE="/data/as"
# remote server directory to upload backup
BACKUPDIR="/backup"
# login to remote server
ftp -n -i $SERVER <<EOF
user $USERNAME $PASSWORD
cd $BACKUPDIR
mput $FILE/*.tar.gz
quit
EOF
[/code]
the above ftp script doesnt work - it gives an error even though the file does exist after I run the first script
AUTH not understood KERBEROS_V4 rejected as an authentication type
/data/as/001.tar.gz: No such file or directory
I need to make this as a single script so I can run it in the background as a cron job
thanks
ftp script to make a backup?
Re: ftp script to make a backup?
Hi,
maybe you should use "lftp" instead of 'ordinary' ftp
and get some script code from my FTP backup [url=http://centosforserver.blogspot.com/2010/02/backup-script-with-tar-incremental.html]script[/url]
good luck
maybe you should use "lftp" instead of 'ordinary' ftp
and get some script code from my FTP backup [url=http://centosforserver.blogspot.com/2010/02/backup-script-with-tar-incremental.html]script[/url]
good luck
-
- Posts: 2
- Joined: 2016/06/07 18:30:56
Re: ftp script to make a backup?
when run sh file following error giving
''The system cannot find the file specified.''
Thanks,
Thusitha
''The system cannot find the file specified.''
Thanks,
Thusitha