LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   VPS backup to remote FTP (https://www.linuxquestions.org/questions/linux-server-73/vps-backup-to-remote-ftp-4175420594/)

ChristianLJ 08-06-2012 03:05 AM

VPS backup to remote FTP
 
Hello,

I am trying to make a backup script for my CentOS VPS. It should make the backup to a local FTP server.

I have the following script which works as intended:

Quote:

#!/bin/sh
HOST="11.11.11.11"
USER="admin"
PASSWORD="xxxxx"
TODAY=$(date +%Y-%d-%m_%H:%M)
ftp -nv <<EOF
open $HOST
user $USER $PASSWORD
mkdir /xxx_BACKUP/$TODAY
cd /xxx_BACKUP/$TODAY
EOF
echo -e "FTP backup done!"
I need the part where i copy a file from my VPS, let it be /srv/blabla/file.txt and put it on my FTP server in the directory /xxx_BACKUP/$TODAY

I have tried with put, get and mput. Nothing seems to work.

What am i missing?

frieza 08-07-2012 12:09 PM

not a direct answer to your query but you might be able to simplify the script by installing fuse curlftpfs, mounting the ftp server(s) as local volumes and performing a standard copy operation.


All times are GMT -5. The time now is 11:05 AM.