updated, tested and bugfixed script
This commit is contained in:
parent
50afd04b7d
commit
4ffe9c6e42
32
deploy-via-ftp.sh
Normal file → Executable file
32
deploy-via-ftp.sh
Normal file → Executable file
@ -1,17 +1,23 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# -*- coding: utf8 -*-
|
||||
|
||||
# see here: https://stackoverflow.com/a/32235669
|
||||
|
||||
#get username and password
|
||||
USER=username #Your username
|
||||
PASS=password #Your password
|
||||
HOST="myftpserver.com" #Keep just the address
|
||||
LCD="~/Desktop/localfolder" #Your local directory
|
||||
RCD="/users/user" #FTP server directory
|
||||
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;
|
||||
"
|
||||
|
||||
lftp -f "
|
||||
open $HOST
|
||||
user $USER $PASS
|
||||
lcd $LCD
|
||||
mirror --continue --reverse --delete --verbose $LCD $RCD
|
||||
bye
|
||||
"
|
||||
Loading…
Reference in New Issue
Block a user