Skip to content
This repository has been archived by the owner. It is now read-only.
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time


Ubuntu One file services will shut down. So, there makes no sense maintaining this project up to date. If you want to backup your files try the Dropbox version in

Files and MySQL Backup script that syncs with Ubuntu One

How to

The class code is defined in u1backup.php and a simple usage example is at backup.php. You can (should) create a cron job to execute your version of backup.php in a regular basis.

What it does

The class made available here will dump your MySQL databases (one or more) and save them into a folder (defined by you - test if the script can write to this folder). From version 1.1, it also lets you backup directories.

Next, it will connect to Ubuntu One using the credentials you provide. If it's the first time running the script, it will create a file named u1backup with the token information from Ubuntu One.

When you execute it a second time, the token info will be already available and the script won't authorize itself twice (unless you delete the file u1backup).

Finally, the files will be uploaded to Ubuntu One using OAuth PUT.

What you need

Besides setting things up in the script, you need PHP's OAuth. After you have it installed, remember that this script will run in CLI, which meand you need to enable OAuth in php.ini for CLI (it's a different file than Apache's).


Most of this code came from the web, so these are the sources:


Files and MySQL backup script that syncs with Ubuntu One




You can’t perform that action at this time.