24 lines
720 B
Bash
Executable File
24 lines
720 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# -*- coding: utf8 -*-
|
|
|
|
# see here: https://stackoverflow.com/a/32235669
|
|
|
|
#get username and password
|
|
USER="***REMOVED***" #Your username
|
|
PASS="***REMOVED***" #Your password
|
|
HOST="tobias-radloff.de" #Keep just the address
|
|
LOCAL_BASE_DIR="/home/tobias/Software/Websites/t-r.de" #Your local directory
|
|
REMOTE_BASE_DIR="/www" #FTP server directory
|
|
|
|
lftp -c "
|
|
open $HOST;
|
|
user $USER $PASS;
|
|
lcd $LOCAL_BASE_DIR;
|
|
cd $REMOTE_BASE_DIR;
|
|
rm -rf tmp/;
|
|
mirror --reverse --continue output $REMOTE_BASE_DIR/tmp;
|
|
mv $REMOTE_BASE_DIR/tobias-radloff.de $REMOTE_BASE_DIR/tobias-radloff.de-old;
|
|
mv $REMOTE_BASE_DIR/tmp $REMOTE_BASE_DIR/tobias-radloff.de;
|
|
"
|
|
|