You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
431 B
Bash
20 lines
431 B
Bash
7 years ago
|
#!/bin/sh
|
||
|
#
|
||
|
# LXC to btrfs subvolume converter
|
||
|
# Convert the LXC rootfs into a btrfs subvolume to
|
||
|
# backup with btrfs snapshots.
|
||
|
#
|
||
|
for rootfs in /var/lib/lxc/*/rootfs; do
|
||
|
{
|
||
|
mv "${rootfs}" "${rootfs}.saved"
|
||
|
btrfs subvolume create "${rootfs}"
|
||
|
mv "${rootfs}.saved"/* "${rootfs}"
|
||
|
rmdir "${rootfs}.saved"
|
||
|
echo "${rootfs} to subvolume\n"
|
||
|
}
|
||
|
done
|
||
|
#for rootfs in /var/lib/lxc/*/rootfs;
|
||
|
#do
|
||
|
# echo "${rootfs}"
|
||
|
#done
|