File: create_snapshot

package info (click to toggle)
evms 2.5.2-1.sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 14,248 kB
  • ctags: 15,488
  • sloc: ansic: 201,340; perl: 12,421; sh: 4,262; makefile: 1,516; yacc: 316; sed: 16
file content (31 lines) | stat: -rwxr-xr-x 523 bytes parent folder | download | duplicates (2)
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
#!/bin/bash
#
# Use the EVMS CLI to create a Snapshot feature-object.

readonly=$1

if [ "$readonly" = "-ro" ]; then
	writeable="false"
	shift
else
	writeable="true"
fi

child=$1
name=$2
origin=$3
chunksize=$4

if [ -z $origin ]; then
	echo "USAGE: `basename $0` [-ro] object snapshot_name origin_volume [chunk_size]"
	exit 1
fi

if [ -n $chunksize ]; then
	chunksize=64
fi

evms -s << EOF > /dev/null
create:object,Snapshot={snapshot=${name},original=${origin},chunksize=${chunksize}KB,writeable=${writeable}},$child
EOF