Created
November 7, 2018 16:02
-
-
Save farkasmate/9fc4ff5f012fbfed931c104c80c2a4a6 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
| #!/bin/bash | |
| if [ $# != 1 ] | |
| then | |
| echo "Usage: $(basename $0) <directory>" | |
| exit 1 | |
| fi | |
| file="$(basename $1)-$(date --iso-8601=seconds).cpio.gz" | |
| find $1 -depth -mount -print0 | cpio --create --quiet --null | gzip --to-stdout > $file | |
| chmod 0400 $file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment