January 2004
Intermediate to advanced
368 pages
7h 25m
English
Related to the task of backing up entire file systems is the user-centric task of taking a snapshot of a specific directory or directory tree. This simple script allows users to easily create a compressed tar archive of a specified directory.
#!/bin/sh # archivedir - Creates a compressed archive of the specified directory. maxarchivedir=10 # size, in blocks, of 'big' directory compress=gzip # change to your favorite compress app progname=$(basename $0) if [ $# -eq 0 ] ; then echo "Usage: $progname directory" >&2 ;exit 1 fi if [ ! -d $1 ] ; then echo "${progname}: can't find directory $1 to archive." >&2; exit 1 fi if [ "$(basename $1)" != "$1" -o "$1" = "." ] ; then echo "${progname}: You must specify ...Read now
Unlock full access