Skip to content

Instantly share code, notes, and snippets.

@alcidesfp
Last active August 29, 2015 14:04
Show Gist options
  • Save alcidesfp/95f32461b78bbf109fe2 to your computer and use it in GitHub Desktop.
Save alcidesfp/95f32461b78bbf109fe2 to your computer and use it in GitHub Desktop.
Respalda carpeta actual en Kawa
":"; 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