master
Marc Wäckerlin 6 years ago
parent 182df98cef
commit ea67543ab8
  1. 4
      README.md
  2. 10
      lizardfs/lizsrdfs-snapshots.sh

@ -1,8 +1,8 @@
Backup And Snapshot Scripts Backup And Snapshot Scripts
=========================== ===========================
- [BTRFS](btrfs/README.md) - [BTRFS](btrfs)
- [LizardFs](lizardfs/README.md) - [LizardFs](lizardfs)
Installation Installation
------------ ------------

@ -46,11 +46,13 @@ OPTIONS
CONFIGURATION FILE 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: This may define the following bash variables:
HOURLY_DEL, DAILY_DEL, WEEKLY_DEL, MONTHLY_DEL 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 SOURCES bash array that defines the sources to backup
DESTINATION snapshot target path DESTINATION snapshot target path
@ -105,7 +107,7 @@ for src in "${SOURCES[@]}"; do
target="${src##*/}${periodity}" target="${src##*/}${periodity}"
if test $dryrun -eq 1; then if test $dryrun -eq 1; then
echo -e "→ \e[1mbackup $src\e[0m" 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 if test -n "$del"; then
for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do
echo " " "rm -rf '$f'" echo " " "rm -rf '$f'"
@ -113,7 +115,7 @@ for src in "${SOURCES[@]}"; do
fi fi
else else
echo -e "→ \e[1mbackup $src\e[0m" echo -e "→ \e[1mbackup $src\e[0m"
lizardfs snapshot "${src}" "${DESTINATION}/${target}${date}" lizardfs makesnapshot "${src}" "${DESTINATION}/${target}${date}"
if test -n "$del"; then if test -n "$del"; then
for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do for f in $(ls -d1 "${DESTINATION}/${target}"-* | sort -r | tail -n +"$del"); do
rm -rf "$f" rm -rf "$f"

Loading…
Cancel
Save