Page 1 of 2

restore user permisson denied

Posted: Thu Apr 20, 2017 12:50 am
by donkow
Hello..

I want to migrate my stuff to another server so ive used the backup command and this:
v-restore-user admin admin.2017-04-04.tar


but everytime i get after press enter
PERMISSON DENIED


i dont rly know why........
if me anyone can help i will spent something to the com.... this problem makes me headache

sry for my english im african

Re: restore user permisson denied

Posted: Thu Apr 20, 2017 7:33 am
by skurudo
You're restore archive under root , right?

Re: restore user permisson denied

Posted: Thu Apr 20, 2017 11:36 am
by donkowafrob
yes i tried this under root and under the admin@XXXXX login...

under root directly i get: PERMISSON DENIED
under admin i get: COMMAND not found...

[email protected]
/usr/local/vesta/bin/v-restore-user xxxx xxx
-> COMMAND NOT FOUND

[email protected]
sudo /usr/local/vesta/bin/v-restore-user xxxx xxx
-> PERMISSON DENIED


[email protected]
v-restore-user xxxx xxx
-> PERMISSON DENIED






** Sorry for the new account here. i was yesterday so tired that i forgot my details **

Re: restore user permisson denied

Posted: Mon Apr 24, 2017 10:40 am
by skurudo
Fist at all:
viewtopic.php?t=9685#p34354

And next..

Code: Select all

cd /backup

Code: Select all

v-restore-user user user-backup-archive

Re: restore user permisson denied

Posted: Wed Oct 04, 2017 2:12 pm
by cthemudo
Hey, I had the same problem, but i didn't found de solution in the forum.

Code: Select all

[root@server]# v-restore-user user user.2017-10-04_124531.tar
Error: permission denied
I checked var and scripts and all is fine:

Code: Select all

[root@server]# echo $VESTA
/usr/local/vesta
[root@server]# head -n15 /usr/local/vesta/bin/v-restore-user
#!/bin/bash
...
# Import VESTA variable for cron launch
source /etc/profile
...
But I found a solution. I exec:

Code: Select all

[root@server]# bash -x /usr/local/vesta/bin/v-restore-user user user.2017-10-04_124531.tar
and saw:

Code: Select all

...
+ [[ user.2017-10-04_124531.tar =~ ^user.[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9].tar$ ]]
+ check_result 10 'permission denied'
...
My VestaCP create backups with date_time, but v-restore-user check file ONLY with date.
The solution is simple:

Code: Select all

[root@server]# mv user.2017-10-04_124531.tar user.2017-10-04.tar
[root@server]# v-restore-user user user.2017-10-04.tar

Re: restore user permisson denied

Posted: Wed Oct 04, 2017 2:34 pm
by imperio
cthemudo, do you modified the v-backup-user script?

Re: restore user permisson denied

Posted: Thu Oct 05, 2017 11:37 am
by cthemudo
SORRY! My fault!

My admin modified the v-backup-user script for have multiples backups in one day.

He changed in /usr/local/vesta/bin/v-backup-user
time_n_date=$(date +'%T %F') <-> time_n_date=$(date +'%T %F_%H%M%S')

Sorry again!

Re: restore user permisson denied

Posted: Thu Oct 05, 2017 11:46 am
by imperio
I think he used this modification https://github.com/serghey-rodin/vesta/pull/1289, but this modification is not official and not tested by project staff.
We recommend you to use the test servers if you will want to help us with testing third-party modifications.

Re: restore user permisson denied

Posted: Sat Oct 21, 2017 10:47 am
by skamasle
imperio wrote:I think he used this modification https://github.com/serghey-rodin/vesta/pull/1289, but this modification is not official and not tested by project staff.
We recommend you to use the test servers if you will want to help us with testing third-party modifications.
Actually it works, but maybe he not change v-restore-user part so, he can create backups but not restore it.

The problem of this is than you need apply patch to all servers you use :/

Re: restore user permisson denied

Posted: Fri Feb 22, 2019 5:09 am
by menriquez
changing the backup filename to include the date of the backup in the format <user>.<yyyy-mm-dd>.tar worked for me after i had changed the backup filename\