Andreas Bernauer wrote:
;; [untested]
Hope this helps,
Andreas.
yes, that was some beautiful work. thanks. I had to toss in an (apply
append (glob
but now it works perfectly and is much more concise. finished script below
;;; Redone (very well!) by Andreas Bernauer
(define *root* "/cygdrive/c")
;; Return a function that roots with the given directory.
(define root
(lambda (root)
(lambda directory
(path-list->file-name directory root))))
(define backup-files
(apply
append
(map
(lambda (F) (glob F))
(map (root *root*)
(append
(map (root "Documents and Settings/metaperl/My Documents")
'("counting-principle.sxi"
"hacks/scm/source-code-documenters.scm"))
(map (root "cygwin/home/metaperl")
'("psl/teaching/Praxis/study-questions/*.scm"
"hacks/masonstar/*.scm"
"psl/mydocs/*.tm"
".bashrc"
"sbin/netdump"
"hacks/scheme/transpose.scm"
"psl/teaching/M.Ed-Schools/drexel-sla-ref.doc"
"psl/teaching/M.Ed-Schools/drexel-stmtofpurpose.sxw"
"psl/metaphysics/kriya-questions.txt"
"psl/diary.scm"))))))))
(define hosts
(list
"metaperl@urth.org"
"princepawn@perlmonk.org"
"metaperl@eskimo.com"))
;; the basename of the .tar and .gz files to be created
;; Note: I root the tar file, too.
(define base-dump ((root *root*) "base-dump"))
(define tar-file (string-append base-dump ".tar"))
(define gz-file (string-append tar-file ".gz"))
;; no chdir necessary
(run (tar cvf ,tar-file ,@backup-files))
(run (gzip --best --force ,tar-file))
(for-each (lambda (host)
(let ((scp-host (string-append host ":")))
(run (scp ,gz-file ,scp-host))))
hosts)
|