Skip to content

Instantly share code, notes, and snippets.

View kitobelix's full-sized avatar

John kitobelix

  • Generic public profile
  • Argentina
View GitHub Profile
@cPFence
cPFence / delete_old_backups
Created March 2, 2025 11:50
Delete Old Snapshot Backups in Enhance v12 ext4
# Dry-run version
DAYS=2
SECONDS_OLD=$((DAYS * 86400))
for site in /backups/*; do
[ -d "$site" ] || continue
current_snapshot=$(readlink "$site/current")
echo "Checking site: ${site##*/}"
find "$site" -maxdepth 1 -type d -name "snapshot-*" | while read -r snapshot; do
if [ "$snapshot" = "$current_snapshot" ]; then
@echo off & setlocal enableextensions
title Reset AnyDesk
reg query HKEY_USERS\S-1-5-19 >NUL || (echo Please Run as administrator.& pause >NUL&exit)
chcp 437
call :stop_any
del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf"
del /f "%APPDATA%\AnyDesk\service.conf"
copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%\"
rd /s /q "%temp%\thumbnails" 2>NUL
xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails"