File: dar_par_create.duc

package info (click to toggle)
dar 2.8.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,024 kB
  • sloc: cpp: 86,219; sh: 6,978; ansic: 895; makefile: 489; python: 242; csh: 115; perl: 43; sed: 16
file content (36 lines) | stat: -rwxr-xr-x 1,029 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

###
#
# this script is to be launched on dar command line when creating an archive with -s option (slicing)
# you need to run this script from dar, adding the following argument on command-line
#
#     -E "dar_par_create.duc %p %b %N %e %c 20"
#
# note that 20 means 20% of redundancy, tune it to your needs
#
###
#
# if you prefer you can also add the line above in your the $HOME/.darrc file
# under the create: conditional statement (see dar man page)
#
###
#
# usage par_script slice.basename slice.number extension level
# generates a Parchive redundancy file from the slice file
#
###

if [ "$1" = "" -a "$2" = "" -a "$3" = "" -a "$4" = "" -a "$6" = "" ]; then
  echo "usage: $0 <path> <basename> <slice number> <extension> <context(not used)> <redundancy ratio (%)>"
  echo "$0 builds Parchive redundancy file for the given slice"
  exit 1
fi

# change according to you need
PAR=par2

echo "creating PAR file for file $1/$2.$3.dar ..."

exec $PAR c -r$6 -n1 "$1/$2.$3.$4"
# script returned code it those of par