Wollte heute mal ein TYPO3 Projekt ganz unkompliziert über rsync/ssh auf den Webserver hochladen. Funktioniert ganz gut mit:
1 | rsync -rulzPh -e 'ssh -ax' ./ ssh-user@ssh-host:/directory |
Die Optionen sind -r für rekursiv, -u für update, -l für symbolische Links (erhalten), -z für Komprimierung, -P für –progress (Fortschrittsanzeige) und –partial (erlaubt anscheinend fortsetzen von Dateitransfers) und -h für “human readable” Formate. Mit -e schaltet man die Remote Shell um (da ich ja über SSH verbinde). Damit man aber nicht die ganzen Temp-Dateien und den sonstigen MacOS Filesystem-Mist mit transferiert, erstellt man am besten eine Datei, die zu exkludierende Dateien enthält. Diese hab ich “.rsync_exclude” genannt. Der Inhalt sieht dann wie folgt aus:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # exclude this file - .rsync_exclude # exclude mac files - .DS_Store - ._* # exclude git repository - .git # exclude typo3 temp files - /public/typo3temp/* - /public/typo3conf/temp_* # exclude typo3 install file - /public/typo3conf/ENABLE_INSTALL_TOOL # exclude typo3 deprecation logs - /public/typo3conf/deprecation_* |
Nun muss man beim Aufruf einfach nur noch --exclude-from=.rsync_exclude anhängen und ab gehts!