Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- while [ -n "$1" ]
- do
- case "$1" in
- --input_folder)
- inp_fold=$2
- ;;
- --extension)
- ext=$2
- ;;
- --backup_folder)
- back_fold=$2
- ;;
- --backup_archive_name)
- arch_name=$2
- ;;
- esac
- shift
- shift
- done
- mkdir $back_fold
- cmp=1
- for file in $(find "$inp_fold" -name "*.$ext")
- do
- file_name=$(basename $file)
- cp $file "$back_fold/($cmp)$file_name"
- (( cmp++ ))
- done
- tar -Pczf $arch_name $back_fold
- echo done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement