rlm@0: ":";exec java -verbose:gc -Xmn500M -Xms1500M -Xmx1500M -server -cp $HOME/roBin/src:$HOME/mobius/src:$HOME/roBin/lib/*:$HOME/Genesis/src:$HOME/mobius/assets:$HOME/mobius/monkey-lib/*:$HOME/workspace/Gauntlet/binary:$HOME/workspace/Clips/bin:$HOME/workspace/Propagators/bin -Djava.library.path=$HOME/roBin/natives/linux clojure.main $0 $*; rlm@0: rlm@0: rlm@0: rlm@0: (ns rlm.push rlm@0: (:gen-class rlm@0: :name rlm.push rlm@0: :main true) rlm@0: (:use [clojure.contrib rlm@0: [duck-streams :only [file-str]] rlm@0: command-line str-utils shell-out] rlm@0: [rlm shell-write rlm@0: [shell-inspect :only [command-line?]]])) rlm@0: rlm@0: rlm@0: (def laserkard ["/home/r/Desktop/web/laserkard" rlm@0: "/home/r/lasercutter" rlm@0: "/home/r/laser-files" rlm@0: "/home/r/emc2"]) rlm@0: rlm@0: (def moonlitnights ["/home/r/Desktop/web/moonlitnights"]) rlm@0: rlm@0: (def judyates ["/home/r/Desktop/web/judyates"]) rlm@0: rlm@0: (def rlmcintyre ["/home/r/Desktop/web/rlmcintyre", rlm@0: "/home/r/Desktop/web/boosterpack" rlm@0: "/home/r/Desktop/web/lib"]) rlm@0: rlm@0: (def bortreb ["/home/r/Desktop/web/bortreb"]) rlm@0: rlm@0: (def aurellem ["/home/r/aurellem/site-output"]) rlm@0: rlm@0: (def mit ["/home/r/Desktop/MIT"]) rlm@0: rlm@0: rlm@0: (def config rlm@0: ["/home/r/.swank-all-repl" rlm@0: "/home/r/.clojure_completions" rlm@0: "/home/r/swank-all" rlm@0: "/home/r/Desktop/web/web.clj" rlm@0: "/etc/lighttpd/lighttpd.conf" rlm@0: "/home/r/.lightpasswords" rlm@0: "/home/r/.profile" rlm@0: "/home/r/.xmodmap.clojure" rlm@0: "/home/r/.xmodmap.xmonad" rlm@0: "/home/r/.xmodmap.normal" rlm@0: "/etc/hosts" rlm@0: "/home/r/Desktop/web/swank-web" rlm@0: "/etc/mercurial/hgrc" rlm@0: "/home/r/.hgrc" rlm@0: "/home/r/.emacs" rlm@0: "/home/r/.emacs.d" rlm@0: "/home/r/.bashrc" rlm@0: "/home/r/.el" rlm@0: "/home/r/.blender" rlm@0: ]) rlm@0: rlm@0: rlm@0: (def admin rlm@0: ["/home/r/Desktop/sliceHost_Admin" rlm@0: "/home/r/Desktop/judyates_admin" rlm@0: "/home/r/Desktop/laserkard_admin" rlm@0: "/home/r/Desktop/moonlitnights_admin"]) rlm@0: rlm@0: (def genesis rlm@0: [;;"/home/r/Desktop/GenesisOutput" rlm@0: "/home/r/Jake2" rlm@0: ;;"/home/r/workspace" --- removed because it interferes with eclipse's rlm@0: ;; color settings. Stupid eclipse. rlm@0: "/home/r/Genesis" rlm@0: ;;"/home/r/eclipse" --- also interfers with eclipse's stupid colors. rlm@0: ;;"/home/r/telmo" rlm@0: ;;"/home/r/sajit" rlm@0: ]) rlm@0: rlm@0: (def projects rlm@0: ["/home/r/aurellem" rlm@0: "/home/r/cortex" rlm@0: "/home/r/mobius" rlm@0: "/home/r/roBin" rlm@0: "/home/r/openal-soft" rlm@0: "/home/r/Desktop/web"]) rlm@0: rlm@0: (defn rsync-string [#^java.io.File file] rlm@0: (if (.isFile file) rlm@0: (.getPath file) rlm@0: (str (.getPath file) "/"))) rlm@0: rlm@0: rlm@0: (defn rsync-one [destination #^java.io.File file] rlm@0: (let rlm@0: [command rlm@0: ["rsync" "-avzhO" "--delete" "--relative" (str "/." (rsync-string file)) destination ]] rlm@0: (println command) rlm@0: ;(apply sw command) rlm@0: command rlm@0: )) rlm@0: rlm@0: rlm@0: (defn rsync [destination args] rlm@0: (doall (map (partial rsync-one destination) (map file-str args)))) rlm@0: rlm@0: (def destinations {"slice" "r@173.203.202.72:/" rlm@0: "rlm" "r@10.0.0.2:/" rlm@0: "sphere" "/home/r/sphere" rlm@0: }) rlm@0: rlm@0: rlm@0: rlm@0: (defn push-gen [& args] rlm@0: (with-command-line args rlm@0: "Push Files from this Computer to others." rlm@0: [[all? a? "Update everything. (except genesis and admin)" false] rlm@0: [l? laserkard? "laserkard source" false] rlm@0: [m? moonlitnights? "moonlitnights source" false] rlm@0: [j? judyates? "judyates source" false] rlm@0: [r? rlmcintyre? "rlmcintyre source" false] rlm@0: [b? bortreb? "bortreb repository source" false] rlm@0: [c? config? "webserver config files" false] rlm@0: [d? admin? "website admin folders" false] rlm@0: [g? genesis? "genesis" false] rlm@0: [p? projects? "roBin, aurellem, mobius" false] rlm@0: [e? everything? "absolutely everything" false] rlm@0: [k? mit? "MIT" false] rlm@0: [u? aurellem? "aurellem SITE"] rlm@0: [target t rlm@0: (str "Target computer. mappings are " destinations " or any ipv4 ip address") rlm@0: "rlm"]] rlm@0: rlm@0: (if e? (into (push-gen "-g" "-d" "-k" "-t" target) (push-gen "-a" "-t" target)) rlm@0: (if all? rlm@0: (push-gen "-l" "-m" "-j" "-r" "-b" "-c" "-p" "-u" "-t" target) rlm@0: (let [target (get destinations target (str "r@" target ":/"))] rlm@0: rlm@0: (map (partial str-join " ") rlm@0: (reduce into rlm@0: (filter rlm@0: (comp not nil?) rlm@0: [ rlm@0: (if u? (rsync target aurellem) nil) rlm@0: (if k? (rsync target mit) nil) rlm@0: (if l? (rsync target laserkard) nil) rlm@0: (if m? (rsync target moonlitnights) nil) rlm@0: (if j? (rsync target judyates) nil) rlm@0: (if r? (rsync target rlmcintyre) nil) rlm@0: (if b? (rsync target bortreb) nil) rlm@0: (if c? (rsync target config) nil) rlm@0: (if d? (rsync target admin) nil) rlm@0: (if g? (rsync target genesis) nil) rlm@0: (if p? (rsync target projects) nil)])))))))) rlm@0: rlm@0: (defn push [& args] rlm@0: (let [commands (apply push-gen args)] rlm@0: (if (not (nil? commands)) rlm@0: (dorun (map sw commands))))) rlm@0: rlm@0: (if (command-line?) rlm@0: (apply push *command-line-args*)) rlm@0: rlm@0: