mirror of
https://github.com/ellysh/bash-programming-from-scratch.git
synced 2026-01-26 07:43:42 +00:00
19 lines
264 B
Bash
19 lines
264 B
Bash
#!/bin/bash
|
|
|
|
operation="$1"
|
|
|
|
case "$operation" in
|
|
"-a")
|
|
find Documents -name "*.pdf" -type f -print0 | xargs -0 bsdtar -c -j -f documents.tar.bz2
|
|
;&
|
|
|
|
"-c")
|
|
cp documents.tar.bz2 ~/backup
|
|
;;
|
|
|
|
*)
|
|
echo "Invalid option"
|
|
exit 1
|
|
;;
|
|
esac
|