Copy backup to another user via UAPI?

Mr.Novo

Member
Apr 9, 2017
18
2
3
Istanbul
cPanel Access Level
Root Administrator
Hi,

I've read the suggestions before about this topic but here is my question.

Can i use restore file to copy files under some users backup directory to another users home directory via uapi with resellers token ?

To make it more clear: i have a reseller account which has access to user1 and user2 and has token for whmapi

Can i use /Backup/restore_files endpoint to copy /backup/user1/<some_folders>/folder2 to /home/user2/<some_folders/folder2 ?
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,519
1,027
313
cPanel Access Level
Root Administrator
Hey there! I don't know of any API calls that are designed to do that. If you have SSH access to the machine, it would be best to just use the copy command over SSH, and then chown the file after that work so it can be managed by user2.
 

Mr.Novo

Member
Apr 9, 2017
18
2
3
Istanbul
cPanel Access Level
Root Administrator
Hey there! I don't know of any API calls that are designed to do that.
Well they are not :)


I've SSH access but i need to do this operation without SSH access. If i am not wrong it's possible to hook a bash script after successfull account creation but I don't want to do that either.

Just trying to figure out a way without this methods.

I'm using skeleton directory already to copy necessary files after account creation but after that operation I need to copy some recent resources which is located in another account.
 

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
519
46
103
Houston, TX
cPanel Access Level
Root Administrator
Hello! I did some research, but it seems there would be no way to get this working without SSH access that we are aware of. However, maybe one of the forum users here will be able to offer some insight. I would highly recommend submitting a feature request per the link in my signature. This will let our development team know there is a desire for this functionality within our API.

Thanks so much for your patience and understanding.
 

Mr.Novo

Member
Apr 9, 2017
18
2
3
Istanbul
cPanel Access Level
Root Administrator
Hi,
I've submitted a feature request thanks.

I just spend hours for this today just want it to work but as you said there is no way around. restore_file method in Backup module might work if API would let us to set destination directory. Instead it only works for accounts directories.

At the end I've updated my script to pull resources from source account but i really want this to be done with API

That way we can use it to move and copy accounts without SSH / bash script / hooks etc. in a flexible way.

I like the idea hope your developers like it to :)

Regards.
 
  • Like
Reactions: cPRex