Created
December 2, 2010 16:11
-
-
Save Cellane/725586 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 bash | |
| echo -n "Zdrojový adresář: " | |
| read zdroj | |
| echo -n "Cílová cesta: " | |
| read cil | |
| echo -n "Stáří (ve formátu AwBdChDmEs): " | |
| read datum | |
| if [ -d $zdroj ]; then | |
| if [ ! -d $cil ]; then | |
| echo "Vytvářím adresář se zálohou!" | |
| mkdir $cil | |
| fi | |
| echo "Vytvářím adresářovou strukturu!" | |
| find $zdroj -type d -exec mkdir $cil/'{}' ';' 2>/dev/null | |
| echo "Kopíruji soubory!" | |
| find $zdroj -type f -atime $datum -exec cp '{}' $cil/'{}' ';' 2>/dev/null | |
| echo "Hotovo!" | |
| else | |
| echo "Neplatná cesta!" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment