Emoncms backup to Dropbox

I’ve just reworked the Dropbox-archive module with the following changes;

  • The majority of the functions are now contained in a bash script instead of php, which allows the use of ‘tar’ to compress the data instead of ‘phar’.
  • This now uses far less RAM than the initial version to complete the compression, and should work OK now with a 30Mb /tmp restriction.
  • It was necessary to create a new default.settings.conf file which allows both php scripts and bash scripts to share a single user settings.conf file.

Upgrading to new version

  1. Git pull, and the latest version will be installed.
  2. Copy the default.settings.conf renamed to settings.conf
  3. Edit settings.conf with your user settings
  4. Delete the old ‘config.php’ file, as it is no longer used.

New install

  1. git clone https://github.com/Paul-Reed/dropbox-archive.git
  2. Copy the default.settings.conf renamed to settings.conf
  3. Edit settings.conf with your user settings
  4. The first time that you run the script, it will prompt you to setup your Dropbox API, just follow the onscreen prompts.- The most common error cause is not copying the authorization URL accurately due to the wrong interpritation of numbers and letters such as O (letter) 0 (number) & 1 (number) I (letter).
    This only needs to be done once, and when completed, run the backup.php script again, and it will create an archive and upload it to dropbox in your Dropbox ‘app’ folder.

Paul

3 Likes