Sync Files to Dropbox with TrueNAS or FreeNAS

Dropbox is one of the most common file-sharing services around, with over 500 million registered users and 400 billion pieces of content. The platform makes it easy to upload content, share links to files, and has free and business versions so organizations can tailor how they wish to implement.

Syncing FreeNAS or TrueNAS with Dropbox has many advantages:

  • Organizations may have a particular dataset on their local NAS accessible via Dropbox for external partners, remote users, or those on a business trip.
  • Individuals or organizations using Dropbox as a business solution may have local backups of Dropbox files so Dropbox space can be freed up periodically, risk-free.
  • Developers using Dropbox for online assets can easily publish and archive deliverables by copying to a NAS share and letting the NAS handle the upload to Dropbox.
  • Users might want to use a Dropbox auto-update folder without having to install Dropbox on their computer or mobile device.

Step 1: Go to your Dropbox account, click on the three dots on the lower right-hand side, and choose Developers. Click Create apps to open the DBX platform and create an app. This process is needed to create a unique access token which FreeNAS and TrueNAS use to identify the account and files. 

 

Step 2: After the app is created, generate the key by clicking Generate access token. 

Step 3: In the FreeNAS or TrueNAS web interface set up your Cloud Credentials under System ➡️ Cloud Credentials. Select Dropbox from the menu and copy in your access token.

Step 4: Save, then go to the Tasks section. Under Cloud Sync Tasks, select your Dropbox account and schedule a sync task. Select the folder on the FreeNAS or TrueNAS system. This can be an existing dataset to sync to Dropbox or a new dataset to back up files in your Dropbox share.

Note: Set the kind of sync needed (Push or Pull) and how to transfer the content: Sync, Copy, or Move.

  • Sync copies any changes from the source system to the destination.
  • Copy copies new files. Files deleted on the host are not deleted on the destination.
  • Move copies files to the destination, then deletes them from the source after the transfer is complete.

Step 5: The Cloud Sync is ready to run at the set time. In the example, FreeNAS is the backup target for a Dropbox account, providing several good features:

  • A FreeNAS or TrueNAS likely has far more capacity than the Dropbox account.
  • Files are protected in case users delete them from the account accidentally.
  • Snapshots can protect files from malware.
  • The dataset can be shared over SMB, NFS, WebDAV, or AFP to a local network for faster access.

Step 6: Check the files. In this example, the Cloud Sync pulled files from Dropbox to the FreeNAS dataset. Creating an SMB, NFS, or WebDAV share of the dataset makes it possible to see if the files are available.  If the transfer is set to push data from the FreeNAS or TrueNAS to Dropbox, log in to Dropbox to verify that the files uploaded correctly. 

16 Comments

  1. Thorsten Behrens

    This is truly ugly. I am looking forward to FreeNAS gaining the capability to act as the app – I think that’s called OAuth. Planned for 1.3? https://redmine.ixsystems.com/issues/64233

    There is another way to do this, via rclone on FreeNAS and a second box with a web browser. That way, it’s not necessary to pretend to be an app developer.

    Reply
  2. Justin Sevakis

    Wait… So copying to and from Dropbox requires separate tasks, and deleting something in one place doesn’t delete in the other place? That’s… not a very good implementation. I hope we can do better than this in the future, because this is not really a usable solution for me.

    Reply
    • Joe

      The Sync option should be the one your looking for. Syncs any changes – new files or deleted files between the two places.

      Reply
  3. Jens Olsson

    I think this is awesome! To be able to have a local copy if disaster strikes.
    The snapshot feature is also a great addition!

    Reply
  4. Nathan Clendenin

    I am hoping to see an implimentation of filtering – to eliminate .DS_STORE files that OS X creates, because right now those files throw an error from Dropbox, which prevents the sync. So if I remove a file from the server and there are .DS_STORE files, the file will remain on Dropbox. This is a hassle more than anything, but still.

    Right not my work around is deleting the invisible files via Terminal, but with many directories, it takes a very long time to scan all the files.

    Reply
  5. Wajahat

    I’ve followed all the steps and it connects but the file upload from freenas to dropbox is stuck at 0%.
    Ive set it as PULL and Move so that the files are uploaded and deleted from freenas folder

    Reply
    • Joe

      Pull would grab files from your Dropbox to your FreeNAS, if you are trying to move files off the FreeNAS to Dropbox you would need to set as Push.

      Reply
  6. Sirui

    That might work when you are looking solely to back up data, but it is not viable for syncing. The problem is that you don’t have real time syncs, but only prescheduled sync tasks. E.g. I have a push & pull at the same time for a folder. When I added a file in my freenas folder and let’s assume the pull task finishes before the push task, my file would just get deleted instead of it being copied to my dropbox.

    Reply
  7. Tim Henderson

    Works for me. I use the FNAS as my local storage device and it is great to finally have an easy way to push backup of my photos, videos, and important file to DB for that extra piece of mind.

    Reply
    • Tim Henderson

      However, being able to kill the service after it is running without having to reboot would be nice. In figuring out the right way I wanted to backup folders in DB I changed my mind a couple of times. Would be nice to kill the current running task without being an shell expert.

      Reply
      • Mike

        Head to the shell, use the ‘top’ command to see which process rclone is running as and kill it using the kill command followed by the process number. E.g. ‘kill ‘

        Reply
    • Mike

      Agreed. In the end I had to move away from the way I was previously using Dropbox, which ultimately is a good thing from a data security perspective. I now use Nextcloud for access to my files as needed, which has replaced most of the Dropbox functionality (so far) and solely use Dropbox as an offsite backup my encrypted data .

      Reply
  8. Andrey

    Okay so I set everything up exactly how this guide suggests.

    After the task downloaded all of my Dropox account contents, it failed and returned “DropBox restricted content”.

    Any help here?

    Reply
    • Joon Lee

      Please file a ticket here: jira.ixsystems.com!

      Might be a permissions issue on Dropbox’s end. You can submit a thread on their forums as well.

      Reply
  9. Francesco

    Thank you for this guide, I can now back up my Dropbox to FreeNAS, which is great

    Reply
    • Joon Lee

      That’s great! Glad you found this guide useful.

      Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

ESG Labs: TrueNAS Technical Report

iXsystems values privacy for all visitors. Learn more about how we use cookies and how you can control them by reading our Privacy Policy.