Created
September 17, 2012 12:09
-
-
Save cimnine/3736954 to your computer and use it in GitHub Desktop.
Sync script for hsr.ch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2004 Sam Hocevar <[email protected]> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
0. You just DO WHAT THE FUCK YOU WANT TO. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env make | |
# | |
# (c) since 2010 by cimnine (find me on cimnine.ch) | |
# | |
# Licensed to you under WTFPL. See COPYING. | |
# | |
# Written for GNU make on OS X, but should be compatible with any make and any Linux/Unix. | |
# | |
# Changelog: | |
# - 17.09.2012: Released to public under WTFPL | |
# - 20.09.2012: Added mount and unmount targets | |
# Silented the makefile and added selective messages | |
# - 20.01.2013: Added APF, BsKon and AI | |
# - 18.02.2013: Extended AI | |
# | |
# Requirements: | |
# - make (on OS X: this means you need to install XCode with CLI Tools) | |
# - samba (on OS X: samba ships with the system) | |
# - rsync (on OS X: rsync ships with the system, or at least with the XCode CLI Tools) | |
# | |
###################### | |
## MANDATORY CONFIG ## | |
###################### | |
# Your skripte folder | |
#OUT=~/Dropbox/skripte/ | |
OUT=./ | |
# Your HSR username | |
USR=cmaeder | |
##################### | |
## OPTIONAL CONFIG ## | |
##################### | |
# The skripte mountpoint (i.e. where to mount the skripte folder) | |
IN=/Volumes/skripte/ | |
# The HSR skripte remote path | |
SMB=//$(USR)@hsr.ch/root/alg/skripte/ $(IN) | |
# Don't sync any file larger than this | |
MS=--max-size=15m | |
# Default Excludes | |
EX=--exclude="Thumbs.db" --exclude="*.lnk" --exclude=".DS_Store" --exclude="*.wav" --exclude="*.avi" | |
# Default Attribs | |
ATTR=-av --no-perms -u $(MS) | |
################### | |
## END OF CONFIG ## | |
################### | |
# If you add a new sync target, add it to this list! | |
# See http://www.gnu.org/software/automake/manual/make/Special-Targets.html#Special-Targets | |
.PHONY: all mnt umnt fs11 hs10 hs11 fs12 hs12 fs13 ICTh BuPL Prog1 Meth1I Bsys1 ReIng Prog2 Prog3 Math2I Bsys2 ReVertr ManagSim Mek2 An1I CN1 SE1 WI1 Ph1Mech PnProg UInt1 An2I CN2 SE2 WI2 UInt2 Vss Dbs1 Dbs2 Ital1 Ph4 ChallP IntTe CompB InfSi1 MsTe PmQm EnCom FKIK BsKon AI SE3 APF | |
.SILENT: mnt umnt fs11 hs10 hs11 fs12 hs12 fs13 all | |
all: mnt fs13 umnt | |
echo Syncing done. | |
mnt: | |
echo Mounting the SKRIPTE folder | |
mkdir -p $(IN) | |
mount -t smbfs $(SMB) | |
umnt: | |
echo Unmounting the SKRIPTE folder | |
umount -f $(IN) | |
hs10: ICTh BuPl Prog1 Math1I Bsys1 ReIng | |
fs11: Prog2 Prog3 Math2I Bsys2 ReVertr ManagSim Mek2 | |
hs11: An1I CN1 SE1 WI1 Ph1Mech PnProg UInt1 | |
fs12: An2I Dbs1 SE2 Ph4 Dbs2 Vss Ital1 | |
hs12: IntTe CompB InfSi1 MsTe PmQm EnCom FKIK | |
fs13: AI APF BsKon | |
ICTh: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Informations-_und_Codierungstheorie/ICTh $(OUT) | |
BuPl: | |
rsync $(ATTR) $(EX) $(IN)/Kommunikation_Wirtschaft_Recht/Business_und_Recht_1/BuPl/Stadelwieser $(OUT) | |
Prog1: | |
rsync $(ATTR) $(EX) --exclude="Archiv/*" $(IN)/Informatik/Fachbereich/Programmieren_1_Programmieren_mit_Java/Prog1 $(OUT) | |
Math1I: | |
rsync $(ATTR) $(EX) --exclude="200*" $(IN)/Mathematik_Naturwissenschaften/Mathematische_Grundlagen_der_Informatik_1/Math1I $(OUT) | |
Bsys1: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Betriebssysteme_1/Bsys1 $(OUT) | |
ReIng: | |
rsync $(ATTR) $(EX) $(IN)/Kommunikation_Wirtschaft_Recht/Business_und_Recht_1/ReIng $(OUT) | |
Prog2: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Programmieren_2_Programmierkonzepte/Prog2 $(OUT) | |
Prog3: | |
rsync $(ATTR) $(EX) --exclude="Admin" $(IN)/Informatik/Fachbereich/Programmieren_3_C++/Prog3 $(OUT) | |
Math2I: | |
rsync $(ATTR) $(EX) $(IN)/Mathematik_Naturwissenschaften/Mathematische_Grundlagen_der_Informatik_2/Math2I $(OUT) | |
Bsys2: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Betriebssysteme_2/Bsys2 $(OUT) | |
ReVertr: | |
rsync $(ATTR) $(EX) $(IN)/Kommunikation_Wirtschaft_Recht/Business_und_Recht_2/ReVertr $(OUT) | |
ManagSim: | |
rsync $(ATTR) $(EX) $(IN)/Kommunikation_Wirtschaft_Recht/Business_und_Recht_2/ManagSim $(OUT) | |
Mek2: | |
rsync $(ATTR) $(EX) $(IN)/Mathematik_Naturwissenschaften/Mathematischer_Ergaenzungskurs_2/Mek2 $(OUT) | |
An1I: | |
rsync $(ATTR) $(EX) $(IN)/Mathematik_Naturwissenschaften/Analysis_1_fuer_Informatiker/An1I $(OUT) | |
An2I: | |
rsync $(ATTR) $(EX) $(IN)/Mathematik_Naturwissenschaften/Analysis_2_fuer_Informatiker/An2I $(OUT) | |
CN1: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Computernetze_1/CN1 $(OUT) | |
CN2: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Computernetze_2/CN2 $(OUT) | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Computernetze_2/CN2Prak $(OUT) | |
WI1: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Wirtschaftsinformatik_1/WI1 $(OUT) | |
WI2: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Wirtschaftsinformatik_2/WI2 $(OUT) | |
UInt1: | |
rsync $(ATTR) $(EX) --exclude="0-admin" $(IN)/Informatik/Fachbereich/User_Interfaces_1/UInt1 $(OUT) | |
UInt2: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/User_Interfaces_2/UInt2 $(OUT) | |
PnProg: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Parallel-_und_Netzwerkprogrammierung/PnProg $(OUT) | |
SE1: | |
rsync $(ATTR) $(EX) --exclude="00-Admin" $(IN)/Informatik/Fachbereich/Software-Engineering_1/SE1 $(OUT) | |
SE2: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Software-Engineering_2/SE2 $(OUT) | |
SE3: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Software-Engineering_3/SE3 $(OUT) | |
Ph1Mech: | |
rsync $(ATTR) $(EX) --exclude="Cossmann" --exclude="Samaras" --exclude="Cossmann Mueller" $(IN)/Mathematik_Naturwissenschaften/Physik_1/Ph1Mech $(OUT) | |
Vss: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Verteilte_SW-Systeme/Vss $(OUT) | |
Dbs1: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Datenbanksysteme_1/Dbs1 $(OUT) | |
Dbs2: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Datenbanksysteme_2/Dbs2 $(OUT) | |
Ph4: | |
rsync $(ATTR) $(EX) $(IN)/Mathematik_Naturwissenschaften/Physik_4 $(OUT)/Ph4 | |
Ital1: | |
rsync $(ATTR) $(EX) $(IN)/Kommunikation_Wirtschaft_Recht/Italienisch_1/Ital1 $(OUT) | |
ChallP: | |
rsync $(ATTR) $(EX) --exclude="VorherigeVeranstaltungen" $(IN)/Informatik/Fachbereich/Challenge_Projekte/ChallP $(OUT) | |
IntTe: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Internettechnologien/IntTe $(OUT) | |
CompB: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Compilerbau/CompB $(OUT) | |
InfSi1: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Internet_Sicherheit_1/IntSi1 $(OUT) | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Informationssicherheit_1_-_Grundlagen/InfSi1 $(OUT) | |
MsTe: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Microsoft-Technologien/MsTe $(OUT) | |
PmQm: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Projekt-_und_Qualitaetsmanagement/PmQm $(OUT) | |
EnCom: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Enterprise_Computing/EnCom $(OUT) | |
FKIK: | |
rsync $(ATTR) $(EX) $(IN)/Kommunikation_Wirtschaft_Recht/Fuehrungskommunikation_im_internationalen_Arbeitsmarkt/FK $(OUT)/FKIK/ | |
rsync $(ATTR) $(EX) $(IN)/Kommunikation_Wirtschaft_Recht/Fuehrungskommunikation_im_internationalen_Arbeitsmarkt/IK $(OUT)/FKIK/ | |
AI: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Artificial_Intelligence_AI/AI $(OUT) | |
APF: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Advanced_Patterns_und_Frameworks/APF $(OUT) | |
BsKon: | |
rsync $(ATTR) $(EX) $(IN)/Informatik/Fachbereich/Betriebssystemkonzepte/BsKon $(OUT) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment