UAPI +PHP. Backup from array list From server to Server

Cassiano Aquino

Registered
Dec 7, 2017
3
1
3
Brazil
cPanel Access Level
Reseller Owner
Hi!

I have an array of my WHM websites (host, user, pass), i need to host a script in my root server, that reads the array and send the generated backups to another FTP Server.

I used to do this with "xmlapi", and access with Cron, but my host updated cPanel so it stopped running.

Is it possible with UAPI? Could you help to build it?
 

Cassiano Aquino

Registered
Dec 7, 2017
3
1
3
Brazil
cPanel Access Level
Reseller Owner
Hello, i managed to build what i wanted, i will post a pastebin link in case someone needs.

But basicly it runs an array with FTP servers and fires a Fullbackup of them to another server. The access is made with Cron.

In case someone finds out my code sucks, and wish to contribute, no problem, i don´t mind....My code is missing some things that i can´t deal right now.

Thanks to N1ghteyes, he made a class that helped me alot to get what i wanted.

PS: Sorry for any bad writing, my english kinda sucks :P


My code [PHP] #!/usr/bin/php <?php $startMEM = memory_get_usage(); set_time_limit(350); - Pastebin.com
N1ghteyes (cpanel-UAPI-php-class): https://github.com/N1ghteyes
 
Last edited:
  • Like
Reactions: cPanelMichael

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello, i managed to build what i wanted, i will post a pastebin link in case someone needs.
Thanks for sharing the example!

You should consider creating a public repo for the script on GitHub if you have the time. Even if you choose not to maintain it, it makes it easier for others to submit changes, discuss concerns, or fork it to their own repo.

Thank you.