Page 1 of 1

Restoring Multiple acccounts

Posted: Mon Sep 05, 2016 9:34 am
by joni
hallo,

Is thare a way for restoring multiple accounts at once instead of restoring accounts one by one with command ?
And why is Restore Option in VestaCP in controlling panel, can the Restoring be done through this option without command in ssh ?

Re: Restoring Multiple acccounts

Posted: Fri Sep 09, 2016 7:34 am
by Elizine
You can create a bash script something like this:

Code: Select all

#!/bin/bash
DATE=$(date +%F)
FILES=$(find /home/backup -name "*$DATE.tar")
for f in $FILES
do
      FILE=$(basename $f)
      USER=$(echo $FILE | cut -f1 -d".")
      echo "v-restore-user $USER $FILE"
                #v-restore-user $USER $FILE
done
exit 0

Re: Restoring Multiple acccounts

Posted: Wed Oct 23, 2019 9:28 am
by skurudo
A little change in script with date format:

Code: Select all

#!/bin/bash
DATE=$(date +%F %T)
FILES=$(find /backup/ -name "*$DATE.tar")
for f in $FILES
do
                FILE=$(basename $f)
                USER=$(echo $FILE | cut -f1 -d".")
                echo "v-restore-user $USER $FILE"
                v-restore-user $USER $FILE
done
exit 0