Quantcast
Channel: myVesta
Viewing all articles
Browse latest Browse all 273

Backup • Re: New Backup Method with Backblaze Using RCLONE

$
0
0
Ensure Your Custom v-backup-users Still Exists if myVesta Updates Before Backup with a Cron Job

I’ve set up a way to ensure my custom v-backup-users script remains active before backups, even if myVesta updates overwrite it. This uses a cron job to restore the custom version 1 hour before the backup. Here’s a quick guide:

Step 1: Back Up Your Custom Script
Save your modified v-backup-users in a safe location:

Code:

mkdir -p /root/myvesta-custom-scriptscp /usr/local/vesta/bin/v-backup-users /root/myvesta-custom-scripts/v-backup-users
Step 2: Create a Script to Restore Your Custom Version
Create /root/vesta-patch.sh to restore your custom script:

Code:

nano /root/vesta-patch.sh
Add this content:

Code:

#!/bin/bash# Check and replace if the script differsif ! cmp -s "/root/myvesta-custom-scripts/v-backup-users" "/usr/local/vesta/bin/v-backup-users"; then    cp /root/myvesta-custom-scripts/v-backup-users /usr/local/vesta/bin/v-backup-users    chmod 755 /usr/local/vesta/bin/v-backup-usersfi
Save (Ctrl+O, Enter, Ctrl+X) and make it executable:

Code:

chmod 755 /root/vesta-patch.sh

Step 3: Test the Script

Code:

/root/vesta-patch.sh
Check if it updated correctly:

Code:

diff /usr/local/vesta/bin/v-backup-users /root/myvesta-custom-scripts/v-backup-users
(No output means success.)

Step 4: Find Your Backup Schedule on your Vesta panel and set a Cron Job to Run 1 Hour Before Backup

Code:

crontab -e
Add a line to run /root/vesta-patch.sh 1 hour before the backup. For my case:

Code:

0 1 * * 7 /root/vesta-patch.sh
Save and verify:

Code:

crontab -l

--------------------------------------
if you ever decide to modify v-backup-users, update the copy:

Code:

cp /usr/local/vesta/bin/v-backup-users /root/myvesta-custom-scripts/v-backup-users

Statistics: Posted by webxtek — Tue Mar 18, 2025 12:24 am



Viewing all articles
Browse latest Browse all 273

Trending Articles