first commit

This commit is contained in:
2025-11-25 17:54:48 +00:00
commit 9327e9d050
6 changed files with 154 additions and 0 deletions

22
incus-copy.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
#
# https://linuxcontainers.org/incus/docs/main/howto/move_instances/
#
#set -x
while getopts d:u:i:p:f:s: flag
do
case "${flag}" in
d) DEST=${OPTARG};;
m) MODE=${OPTARG};;
esac
done
for CT in $(/usr/bin/incus list -c n -f compact,noheader status=RUNNING) ; do
DATE=$(date '+%Y-%m-%d %H:%M:%S')
echo "[${DATE}] incus copy ${CT} ${DEST}:$CT --refresh --mode push"
/usr/bin/incus copy $CT ${DEST}:$CT --refresh --mode ${MODE} 2>&1 > /dev/null
done