- This topic is empty.
-
AuthorPosts
-
August 18, 2014 at 12:17 pm #179546
chrisburton
ParticipantHey, guys. Some of you may already know that I have Dropbox installed on my VPS. I am trying to get the contents inside a folder to sync to another location on my VPS.
E.g.
- Dropbox is installed in
home/chrisburton/Dropbox/
- Website content is in
home/chrisburton/Dropbox/Website/
I would like the contents inside
/Website/
to go intovar/www/html/
but watchhome/chrisburton/Dropbox/Website/
for updates to any file and sync tovar/www/html/
if there are any changes.Could someone help me with that?
August 18, 2014 at 12:23 pm #179551nixnerd
ParticipantChris,
I don’t use Dropbox but do you think there might be an OFFICIAL soltuion to this? Like one that is unique to Dropbox? What I’m saying is… do you think it’s a matter of getting the Dropbox settings correct? Or are you looking for anything that works?August 18, 2014 at 12:32 pm #179554James Burton
ParticipantHello Chris,
What I think you could do is create a script to check the timestamp of the dropbox folder and if the number is higher than the timestamp in the website folder then copy the new files over to the website from dropbox.
You can setup a script as a cron job every 6 hours to check the version.
James
August 18, 2014 at 12:37 pm #179560chrisburton
ParticipantAugust 18, 2014 at 12:41 pm #179563nixnerd
ParticipantOhhhh nice! That’s exactly what you want. Let me read it for potential pitfalls. BTW… everything written in this article SHOULD work on your Mac. Let me check it out.
August 18, 2014 at 12:45 pm #179565nixnerd
ParticipantHey Chris… what does it currently do now? When you put a file in
home/chrisburton/Dropbox/Website/
, where does it sync to?August 18, 2014 at 12:46 pm #179567Alen
ParticipantThere are two things you could do.
Easiest is to change the Apache config and set the document root to that of DropBox/Website, so Apache will just serve it from there. No need to do anything else.
Second. You could system link it. Basically make a shortcut that points to another location. In your case, you would need to remove the
var/www/html
folder first (obviously make sure you’re not deleting anything important inside). Then create a system link or shortcut namedhtml
that points to your DropBox folder.sudo rm -R /var/www/html sudo ln -s /var/www/html /home/chrisburton/Dropbox/Website/
No need to setup CRON, since you’re making changes locally, upload to DropBox that is synced with the VPS making site reflect those updates automagically.
August 18, 2014 at 12:53 pm #179569Alen
ParticipantStops the service
$ dropbox stop
Copy
dropbox.bd
that is inside~/.dropbox/
folder, and rename it todropbox.db.backup
$ cp ~/.dropbox/dropbox.db dropbox.db.backup
Download Python Script
$ wget http://dl.dropbox.com/u/119154/permalink/dropboxdir.py
Make script executable
$ chmod +x dropboxdir.py
Move the folder to location of your choice
/foo/bar
$ mv ~/Dropbox /foo/bar
Run the Downloaded Script with
--setfolder
flag$ ./dropboxdir --setfolder=/foo/bar
Start the service back up
$ dropbox start
August 18, 2014 at 12:55 pm #179571nixnerd
Participant@alenabdula Just out of curiosity… since I don’t use Dropbox:
What directory is the link Chris posted talking about? The target (to be watched) directory? Or the sync directory? It seemed like it was really only talking about moving one directory and that’s what I didn’t understand.
August 18, 2014 at 12:56 pm #179572nixnerd
ParticipantWhat directory is the link Chris posted talking about? The target (to be watched) directory? Or the sync directory? It seemed like it was really only talking about moving one directory and that’s what I didn’t understand.
Aaaaand you just answered that. Sync directory.
August 18, 2014 at 1:06 pm #179578Alen
ParticipantChris I wouldn’t change the actual location of the Dropbox folder. Use the Apache document root or system link. If you’re only doing this because you wish to serve your site from Dropbox.
August 18, 2014 at 1:12 pm #179579chrisburton
ParticipantAugust 18, 2014 at 1:19 pm #179583Alen
ParticipantCan you run
sudo /sbin/service dropbox stop
August 18, 2014 at 1:21 pm #179585chrisburton
Participantdropbox: unrecognized service
August 18, 2014 at 1:27 pm #179589Alen
ParticipantWhat about
~/.dropbox-dist/dropboxd stop
.How did you initially start the service when you installed it?
- Dropbox is installed in
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.