|
|
|
@ -46,11 +46,13 @@ OPTIONS |
|
|
|
|
|
|
|
|
|
CONFIGURATION FILE |
|
|
|
|
|
|
|
|
|
You can have a configuration file lizardfs-snapshots.conf either in /etc or in your home. |
|
|
|
|
You can have a configuration file lizardfs-snapshots.conf either in |
|
|
|
|
/etc or in your home. |
|
|
|
|
|
|
|
|
|
This may define the following bash variables: |
|
|
|
|
HOURLY_DEL, DAILY_DEL, WEEKLY_DEL, MONTHLY_DEL |
|
|
|
|
defining the parameter --del for hourly, daily, weekly, monthly |
|
|
|
|
defining the parameter --del for |
|
|
|
|
hourly, daily, weekly, monthly |
|
|
|
|
SOURCES bash array that defines the sources to backup |
|
|
|
|
DESTINATION snapshot target path |
|
|
|
|
|
|
|
|
@ -105,7 +107,7 @@ for src in "${SOURCES[@]}"; do |
|
|
|
|
target="${src##*/}${periodity}" |
|
|
|
|
if test $dryrun -eq 1; then |
|
|
|
|
echo -e "→ \e[1mbackup $src\e[0m" |
|
|
|
|
echo " " "lizardfs snapshot '${src}' '${DESTINATION}/${target}${date}'" |
|
|
|
|
echo " " "lizardfs makesnapshot '${src}' '${DESTINATION}/${target}${date}'" |
|
|
|
|
if test -n "$del"; then |
|
|
|
|
for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do |
|
|
|
|
echo " " "rm -rf '$f'" |
|
|
|
@ -113,7 +115,7 @@ for src in "${SOURCES[@]}"; do |
|
|
|
|
fi |
|
|
|
|
else |
|
|
|
|
echo -e "→ \e[1mbackup $src\e[0m" |
|
|
|
|
lizardfs snapshot "${src}" "${DESTINATION}/${target}${date}" |
|
|
|
|
lizardfs makesnapshot "${src}" "${DESTINATION}/${target}${date}" |
|
|
|
|
if test -n "$del"; then |
|
|
|
|
for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do |
|
|
|
|
rm -rf "$f" |
|
|
|
|