Setup Dropbox custom destination in cPanel Server

Category : cPanel/WHM

The cPanel backup system provides lots of backup options we can create custom backup transports as well. In a custom backup destination, we can move backups to a remote server of our choice. In this guide, we are going to set up Dropbox custom destination in the cPanel server.

Requirements to Setup Dropbox as a custom destination in cPanel Server :

  • WHM based server
  • SSH access
  • Dropbox account

Steps :

  1. Login to your Dropbox account and head to the Developer section and select Create an app.
  2. Choose API, Full Dropbox – access and choose a name for your app we have used backups. After adding the details click Create App.
    setup dropbox as backup in whm
  3. After creating the app you will be redirected to the Settings page of your app. Head to the permissions Tab and grant the permission as shown below and press submit.
    setup dropbox as backup in whm
  4. Now head back to the settings tab and copy your App key, App secret and Click on generate Access Token and copy it as well.
    Note: By default, the expiration of Access Token is set to short-lived. Please change it to No-expiration otherwise you will have to keep replacing the token.
  5. Let’s prepare the server for Dropbox. Head to your SSH session and execute the following commands.
    sudo yum install perl-LWP-Protocol-https -y
    sudo cpan CPAN::DistnameInfo
    sudo cpan WebService::Dropbox

    Once the commands are executed the dropbox service should be installed on your server.

  6. Change your directory to the following.
    cd /usr/local/src
    and GIT clone the following repository.
    git clone https://github.com/CpanelInc/backup-transport-dropbox
  7. Copy the backup_transport_dropbox.pl file to /usr/local/bin/ or use the following command.
    cp -av backup-transport-dropbox/backup_transport_dropbox.pl /usr/local/bin/
  8. Now edit the moved file using your preferred file editor. Add your previously saved Dropbox values in the file.
    setup dropbox as backup in whm
  9. Now with the server ready. Let’s configure the WHM. In WHM’s search bar search for Backup Configuration and Select Additional Destinations tab. Choose Custom from the dropdown menu and click on Create New Destination.
    dropbox custom destination
  10. Add the details to the next screen as follows.
    Script path –  /usr/local/bin/backup_transport_dropbox.pl
    You can add any random strings in Remote host, Username, Password as we are using API directly in the script.
    dropbox custom destination whm
  11. Click on Save and Validate Destination.

Congratulations you have successfully created a custom backup with destination dropbox.

Want to run an on-demand backup? Force run backups by following the guide here.