pbxpcitests

This commit is contained in:
2023-02-23 14:35:01 +00:00
parent 3be1178460
commit 3fb0063a0c
4 changed files with 106 additions and 0 deletions

29
backupdir2nas.sh Normal file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
REPOSITORY=marc@nas:/dat/bak/borg
DIR=/media/hdext
REPONAME=sd32pi3
if [ "$1" != "--prune" ]; then
borg create -v --stats --progress --compression zlib --one-file-system \
$REPOSITORY::"$REPONAME-{now:%Y-%m-%d}" \
$DIR \
--exclude '*/tmp/*' \
--exclude '*/tmpfile/*' \
--exclude '/var/tmp/*' \
--exclude '/var/crash/*' \
--exclude '*/.cache/*' \
--exclude '*/cache/*' \
--exclude '*/.ccache/*' \
--exclude '*/mlocate.db*' \
--exclude '*/Downloads/*' \
--exclude '/run'
fi
# Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly
# archives of THIS machine. The '{hostname}-' prefix is very important to
# limit prune's operation to this machine's archives and not apply to
# other machine's archives also.
borg prune -v --stats $REPOSITORY --prefix '{hostname}-' \
--keep-daily=7 --keep-weekly=4 --keep-monthly=20

View File

@@ -13,6 +13,7 @@ borg create -v --stats --progress --compression zlib --one-file-system \
--exclude '*/cache/*' \
--exclude '*/.ccache/*' \
--exclude '*/mlocate.db*' \
--exclude '*/Downloads/*' \
--exclude '/run'
fi

48
backuptostick.sh Normal file
View File

@@ -0,0 +1,48 @@
#!/bin/sh
#REPOSITORY=/media/mhoppe/KEY/bak/borg
#REPOSITORY=/media/stick/bak/borg
REPOSITORY=/media/hdext/bak/borg
name=es
prefix="buero-$name-{hostname}-"
echo $prefix
echo $REPOSITORY::$prefix{now:%Y-%m-%d}
if [ "$1" != "--prune" ]; then
borg create -v --stats --progress --compression auto,lzma --noatime \
$REPOSITORY::$prefix{now:%Y-%m-%d-%H:%M:%S} \
ssh://buero:/home/mhoppe/proj/$name/ \
--exclude '*/dl/' \
--exclude '*/update/' \
--exclude '*/build*/' \
--exclude '*/dest/' \
--exclude '*/dsp/ti' \
--exclude '*/lm_tkhs/source/user/opensource' \
--exclude '*/sdcard/' \
--exclude '*/staging/' \
--exclude '*/rootfs/' \
--exclude '*/output_files/' \
--exclude '*/synthesis/' \
--exclude '*/sourcemirror/' \
--exclude '*/downloads/' \
--exclude '*/sstate-cache/' \
--exclude '*/yocto-dl-sources.git/' \
--exclude '*/tmp*' \
--exclude '*/alt/' \
--exclude '*/*sstate/' \
--exclude '*/sstate-cache/' \
fi
#
# Use the `prune` subcommand to maintain 7 daily, 4 weekly and 6 monthly
# archives of THIS machine. The '{hostname}-' prefix is very important to
# limit prune's operation to this machine's archives and not apply to
# other machine's archives also.
borg prune -v --stats $REPOSITORY --prefix $prefix \
--keep-hourly=10 --keep-daily=7 --keep-weekly=4 --keep-monthly=20

28
pbxnettest Normal file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
ip=192.168.178.234
url=root@$ip
log=$HOME/tmp/pbxnettest_$(date +%y%m%d%H%M%S).log
srcfile=~/tmp/update-image-tfepi-tfepi.swu
n=0
i=0
while [ true ]; do
echo -n "."
scp -q $srcfile $url:/dev/null
r=$?
if [ $r -ne 0 ]; then
echo "Error $n" | tee -a $log
fi
i=$((i+1))
n=$((n+1))
if [ $i -ge 100 ]; then
i=0
echo " $(date +%T) $n" | tee -a $log
fi
read -t 1 -n 1 key
if [ "$key" = "x" ]; then
exit
fi
done