Last active
August 29, 2015 14:04
-
-
Save alcidesfp/95f32461b78bbf109fe2 to your computer and use it in GitHub Desktop.
Respalda carpeta actual en Kawa
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
":"; exec kawa -f $0 "$@" # -*- coding:utf-8; mode:Scheme -*- | |
(define-alias File java.io.File) | |
(define-alias Date java.util.Date) | |
(define-alias DateFormat java.text.SimpleDateFormat) | |
(let* ((this-dir (path-last (*:getCanonicalPath (File ".")))) | |
(backup-date (*:format (DateFormat "yyyyMMdd-HHmm") (Date))) | |
(nom-tar (format #f "~A_~A.tar" this-dir backup-date))) | |
(format #t "Generando respaldo ~A ...~%" nom-tar) | |
(system (format #f "tar -C .. -cf ../~A ~A" nom-tar this-dir)) | |
(format #t "Comprimiendo respaldo ~A...~%" nom-tar) | |
(system (format #f "bzip2 ../~A" nom-tar)) | |
(format #t "Respaldo terminado.~%")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment