A couple of years ago, in an article called Taking your ACT! on Holiday, I discussed the use of Dropbox to help with off-site backups. One of the issues with this is that Dropbox only uploads the files when you’re logged into the system and that means it’s not a great option for backing up the database on your server.
A little research and some testing later, and I have the solution for you –
Run Dropbox as a Windows service
What this means is that, when Windows is running, Dropbox will also be running without you needing to be logged in to the server. The benefit of this is that Dropbox will be able to keep uploading backups created by the Act! Scheduler to the cloud.
So, how do we go about this? Well, we need to install Dropbox and set it up as a service.
- Log into your Windows Server as a local administrator
- Download the Windows Server 2003 Resource Kit, which you can download from:
Note: There isn’t a later version of the Resource Kit. Don’t worry about that if on 2008
You just need the files INSTSRV.EXE and SRVANY.EXE from this kit
- Install the Server Resource Kit or just copy the two files (INSTSRV and SRVANY) to:
C:\Program Files (x86)\Windows Resource Kits\Tools
Note: You only need the two files mentioned. They can be in any folder – I’ve used the location from the default install. If you change the location, you’ll need to adjust those paths in a few spots.
- Download Dropbox from: https://db.tt/82ZOShy
Install and setup Dropbox
- Install Dropbox as per normal
- Select a folder for Dropbox to use – I prefer not to use the user folder for this, so create C:\Dropbox or add a Dropbox folder to your Data folder on the local system.
You’ll set the Act! Scheduler to save the backups into this folder (or a sub-folder)
- Open the Dropbox Preferences, by clicking on the icon in the SysTray, and turn off
- Show desktop notifications
- Start Dropbox on system startup
- Exit Dropbox from the SysTray
Setting up the Service
- There are two options here, depending on which Operating System you’re using:
- If Windows 2003 or 2008,
Open a command prompt, change directory to
C:\Program Files (x86)\Windows Server 2003 Resource Kit\
instsrv Dropbox "c:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe"
If it worked, you should get:
The service was successfully added! .
If Windows 2008 R2, open an elevated command prompt (Run As Administrator) and type:
sc create Dropbox binPath= "C:\Program Files (x86)\Windows Server 2003 Resource Kit\srvany.exe" DisplayName= "Dropbox Service"
If all ok, you’ll get:
[SC] CreateService SUCCESS.
- If Windows 2003 or 2008,
Next open the Services applet – Start > Run > services.msc
Scroll to the Dropbox item in the list. Right-click and select Properties
Switch to the “Log On” tab
- Click “This account”, and enter an Admin account with Full Access to the Dropbox folder. Set the appropriate password for that account.
- Click Apply
- Switch back to the “General” tab
- Change “Startup type” to Automatic
- Click Apply and OK
- If this is the first time you have done this procedure for the administrator user, you may get an notification saying that the “Administrator user has been granted log on as service rights”.
DO NOT START THE SERVICE AT THIS TIME.
- Next is to set up some registry settings for the service. Open the registry editor
Start > Run > regedit
- Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Dropbox
- Create a new key “Parameters”
- Add a new string value “Application”, (type REG_SZ). Set the value to the path to the dropbox.exe binary.
Find the location by right clicking the Dropbox icon on the desktop. Select Properties and copy the Target.
- Close the Registry Editor
- Start the service either from Services.msc or by:
Run > Net start Dropbox
- If you check your Task Manager, you will find both Dropbox and srvany running
Files saved by you or the Act! Scheduler to this folder should be automatically uploaded.
Important Notes and References
- If you want to make changes to the Dropbox preferences:
You MUST stop the service first, make the changes, exit Dropbox and then restart the service
- These methods should also work with the desktop operating systems if you want to do this on XP, Vista, Windows 7 or Windows 8.
- Reference from Microsoft on INSTSRV and SRVANY: How to Create a User-Defined Service
- Reference from Microsoft on: How to Create a Windows Service by Using SC.exe
- There are also some third-party tools that can be more stable in a production system. I haven’t tested them, but here are three I’ve found:
- NSSM - http://nssm.cc/
- SRVStart - http://rozanski.org.uk/software
- AlwaysUp - http://www.coretechnologies.com/products/AlwaysUp/srvany.html
- You should regularly check the backups as I mentioned in my original article:
Taking your Act! on Holiday
Please post in the comments if you have any questions.