Skip to content
Snippets Groups Projects
Commit cdb11e0b authored by Erick Hitter's avatar Erick Hitter
Browse files
parents
Branches
Tags
No related merge requests found
number
*.tar
*.gz*
*.gz
\ No newline at end of file
extract 0 → 100755
#!/bin/bash
# EXTRACTION SCRIPT
# save on file the initial volume number
echo 1 >number
# execute the "change-volume" script a first time
./tar-multi-volume-script x file
# multi-volume archive extraction
tar -M -F './tar-multi-volume-script x file' -xf file.tar 2>&-
# remove a spurious file
rm file.tar
\ No newline at end of file
generate 0 → 100755
#!/bin/bash
# CREATION SCRIPT
# save on file the initial volume number
echo 1 >number
# multi-volume archive creation
tar -ML 200000 -F './tar-multi-volume-script c file' -cf file.tar ~/broadway/www/digiday/wp-content/uploads/ 2>&-
# execute the "change-volume" script a last time
./tar-multi-volume-script c file
\ No newline at end of file
#!/bin/bash
prefix="$1"
n=1
while [[ -e "$prefix-$n.tar" ]]; do
((n++))
done
mv "$prefix.tar" "$prefix-$n.tar"
echo "$prefix-$n.tar"
\ No newline at end of file
#!/bin/bash
# TAR INVOKED SCRIPT
mode="$1"
prefix="$2"
n=$(<number)
case $mode in
c) mv "$prefix.tar" "$prefix-$n.tar" ;;
x) cp "$prefix-$n.tar" "$prefix.tar" ;;
esac
echo $((n+1)) >number
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment