Linux gir02.nhanhoa.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC 2023 x86_64
LiteSpeed
Server IP : 103.124.95.33 & Your IP : 216.73.217.104
Domains :
Cant Read [ /etc/named.conf ]
User : nhsacmvr
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
opt /
nhanhoa /
Delete
Unzip
Name
Size
Permission
Date
Action
checkdisk2
[ DIR ]
drwxr-xr-x
2026-07-26 09:09
check_all_mysql_db_sizes.sh
1.77
KB
-rwxr-xr-x
2025-07-24 18:31
check_avail_backup.sh
2.34
KB
-rwx------
2026-03-19 00:44
check_disk.sh
3.45
KB
-rwxr-xr-x
2025-10-27 01:19
check_disk.sh.1108902.2025-08-23@08:17:25~
8.85
KB
-rwxr-xr-x
2025-08-11 17:34
check_disk.sh.3561032.2025-08-12@00:34:45~
8.94
KB
-rwxr-xr-x
2025-07-25 01:10
check_disk.sh.531086.2025-10-27@08:19:41~
8.85
KB
-rwxr-xr-x
2025-08-23 01:17
check_disk_health.sh
2.87
KB
-rwx------
2026-03-13 03:59
checkbk.sh
1.84
KB
-rwx------
2025-12-29 06:46
collect_cpanel_full_info.sh
5.38
KB
-rwx------
2026-01-29 03:47
get_the_domains.sh
398
B
-rwx------
2026-06-25 10:02
hosting_full.json
179.97
KB
-rw-------
2026-09-25 18:00
report-backup.sh
1.9
KB
-rwxr-xr-x
2025-05-24 03:57
sync_backup.sh
2.18
KB
-rwxr-xr-x
2026-04-09 01:39
Save
Rename
#!/bin/bash ######################################## # CONFIG ######################################## SRC="/backup/cpbackup/" DEST="/backup-nfs/cpbackup/" LOCKFILE="/var/run/sync_backup.lock" LOGFILE="/var/log/sync_backup.log" TIMEOUT=604800 RSYNC_TIMEOUT=1800 # Telegram config (optional) TG_TOKEN="5971131875:AAF1Z11CyKhbpmkXzrMxePMVL0dqT1vusXo" TG_CHAT_ID="-803396545" ######################################## # FUNCTIONS ######################################## log() { echo "$(date '+%F %T') $1" | tee -a "$LOGFILE" } send_telegram() { [ -z "$TG_TOKEN" ] && return curl -s -X POST "https://api.telegram.org/bot$TG_TOKEN/sendMessage" \ -d chat_id="$TG_CHAT_ID" \ -d text="$1" > /dev/null 2>&1 } check_nfs() { if ! mountpoint -q /backup-nfs; then log "ERROR: /backup-nfs not mounted" send_telegram "❌ Backup failed: NFS not mounted on $(hostname)" exit 1 fi # test write touch /backup-nfs/.test_write.$$ 2>/dev/null if [ $? -ne 0 ]; then log "ERROR: NFS write test failed" send_telegram "❌ Backup failed: NFS write error on $(hostname)" exit 1 fi rm -f /backup-nfs/.test_write.$$ } kill_old_rsync() { OLD=$(pgrep -f "rsync.*$SRC") if [ ! -z "$OLD" ]; then log "WARNING: Found old rsync process: $OLD" kill -9 $OLD log "Old rsync killed" fi } ######################################## # MAIN ######################################## ( flock -n 9 || { log "Another backup process is running" exit 1 } START_TIME=$(date +%s) log "===== BACKUP START =====" check_nfs kill_old_rsync log "Running rsync..." timeout $TIMEOUT rsync -aH --delete \ --numeric-ids \ --stats \ --info=progress2 \ --itemize-changes \ -vv \ --timeout=$RSYNC_TIMEOUT \ "$SRC" "$DEST" >> "$LOGFILE" 2>&1 STATUS=$? END_TIME=$(date +%s) DURATION=$((END_TIME - START_TIME)) if [ $STATUS -eq 0 ]; then SIZE=$(du -sh "$DEST" | awk '{print $1}') log "Backup SUCCESS - Time: ${DURATION}s - Size: $SIZE" else log "Backup FAILED - Exit code: $STATUS" send_telegram "❌ Backup FAILED on $(hostname)" fi log "===== BACKUP END =====" ) 9>$LOCKFILE