Skip to main content

Backing up accounts (hacky way)

Comments

11 comments

  • Deehem
    Thanks. I'm using something similar which is the Perl cPanel::PublicAPI module with no luck. It sends the request, but then just refuses to FTP from there and doesn't even send a completion email :( As there are no logs for the end-user backup process, this can't be easily debugged. Quite frustrating.
    0
  • cPanelMichael
    The following thread is dated, but it might help provide you with a general idea of how it's been achieved in the past: Automatic Remote FTP Backup Script Thank you.
    0
  • Deehem
    Thanks for the suggestions. I opted to use the cPanel::PublicAPI Perl module for this. I have attached the full working script below in a gist, for reference. /https://gist.github.com/Deehem/6dd15d79775730e64b34
    0
  • robnelli
    I tried your script method using the cPanel::PublicAPI Perl module but got a 403 Forbidden Access response. Any idea what it was that was denied and how to fix it? debug: Using user param from object creation debug: Using pass param from object creation debug: loaded serializer: JSON::Syck debug: api_request: ( cPanel::PublicAPI=HASH(0x15f8f80), cpanel, /xml-api/cpanel, POST, HASH(0x15f8ef0), ) debug: failed to load encoder: cPanel/CPAN/URI/Escape.pm debug: loaded encoder: URI/Escape.pm debug: Found port for service cpanel to be 2082 (usessl=0) debug: POST /xml-api/cpanel HTTP/1.1 Host: http://www.domain.net Connection: Close Content-Length: 238 User-Agent: cPanel::PublicAPI (perl) 1.002 Authorization: Basic anJuaG9zdGk6bGVlbmllLTE= arg-4=user@ domain.net&cpanel_xmlapi_module=Fileman&cpanel_xmlapi_cpanel_xmlapi_user=&arg-0=ftp&arg-3= xxxxxxxx&cpanel_xmlapi_apiversion=1&arg-1=nj01.domain.com&arg-6=%252F&arg-2=supersof&arg-5=21&cpanel_xmla pi_func=fullbackup debug: HTTP LINE[HTTP/1.1 403 Forbidden Access denied ] debug: HEADER[content-type]=[text/xml] debug: HEADER[connection]=[close] debug: HEADER[server]=[cpsrvd/11.42.1.13] debug: READ TYPE=close Server Error from domain.net: HTTP/1.1 403 Forbidden Access denied
    0
  • caylean
    [quote="Deehem, post: 1637131">I opted to use the cPanel::PublicAPI Perl module for this.
    Hello Daahem, I ran into a problem too, maybe I have missed something... [QUOTE]Can't locate cPanel/PublicAPI.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /home/ACCOUNTNAME/public_html/backup/backup.pl line 3. BEGIN failed--compilation aborted at /home/ACCOUNTNAME/public_html/backup/backup.pl line 3.
    Where can i find that Public Api? Had searched in cPanel for it, but nothing was to be found. Kind Regards
    0
  • cPanelMichael
    The previous poster is referencing the following:
    0
  • John connor
    I have no idea how to run Perl. I have a Perl Module Installer in cPanel. How do I do this? Do I place the cpanel_backup.pl in th ePerl folder of the directory in FTP? Do I run a cron job? How do I install the Public API? [COLOR="silver">- - - Updated - - - I should mention that I'm on a shared account, not a VPS so it looks like I have to run commands and I don't think I can do that.
    0
  • cPanelMichael
    [quote="John connor, post: 1826931">I have no idea how to run Perl. I have a Perl Module Installer in cPanel. How do I do this? Do I place the cpanel_backup.pl in th ePerl folder of the directory in FTP? Do I run a cron job? How do I install the Public API? - - - Updated - - - I should mention that I'm on a shared account, not a VPS so it looks like I have to run commands and I don't think I can do that.
    You can upload the custom Perl script to your account's home directory and utilize the path to it when setting up a cron job. The "Perl Modules" option in cPanel should allow you to install the "cPanel: PublicAPI" Perl module. Note that this is an unsupported user-submitted backup script, so it's not something we can support. Thank you.
    0
  • mimin
    You can upload the custom Perl script to your account's home directory and utilize the path to it when setting up a cron job. The "Perl Modules" option in cPanel should allow you to install the "cPanel::publicAPI" Perl module. Note that this is an unsupported user-submitted backup script, so it's not something we can support. Thank you.

    Michael, what is the best choices for you if you need something like what OP asked ?
    0
  • cPanelMichael
    Michael, what is the best choices for you if you need something like what OP asked ?

    The main purpose of the custom script is to allow cPanel users the ability to automatically backup accounts on a daily basis. If you are asking for the best supported option, it would be to obtain a VPS or dedicated server so you can configure backups as "root" using the supported options provided by cPanel. Thank you.
    0

Please sign in to leave a comment.