Victor LABORIE
842e57ba53
* Jails are created on start and run in tmpfs * All config files are on /etc/bkctld * Cleaning of sshd_config and /etc/group
28 lines
873 B
Bash
Executable file
28 lines
873 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# Make incremental inc of all jails
|
|
# Usage: inc
|
|
#
|
|
|
|
LIBDIR="$(dirname $0)" && . "${LIBDIR}/config"
|
|
|
|
date=$(date +"%Y-%m-%d-%H")
|
|
for jail in $("${LIBDIR}/bkctld-list"); do
|
|
inc="${MOUNT_POINT}/${jail}/${date}"
|
|
if [ -d "${MOUNT_POINT}/${jail}/last" ]; then
|
|
if [ ! -d "${inc}" ]; then
|
|
start=$(date +"%H:%M:%S")
|
|
jail_inode=$(stat --format=%i "${MOUNT_POINT}/${jail}/last")
|
|
if [ "$jail_inode" -eq 256 ]; then
|
|
/bin/btrfs subvolume snapshot -r "${MOUNT_POINT}/${jail}/last" "${inc}" | debug
|
|
else
|
|
cp -alx "${MOUNT_POINT}/${jail}/last" "${inc}" | debug
|
|
fi
|
|
end=$(date +"%H:%M:%S")
|
|
notice "${jail} : made ${date} inc [${start}/${end}]"
|
|
else
|
|
warning "${jail} : trying to made already existant inc"
|
|
fi
|
|
fi
|
|
done
|