seventh

How to sync dir "/"

Recommended Posts

I want to sync all data from my Ubuntu server except directories with .SyncIgnore. But nothing happens when I write in config:


"shared_folders" :
[
{
"secret" : "blablabla",
"dir" : "/",
etc...

In log I see

Error while adding folder /: Can't open the destination folder.

How can I do it with btsync?

Share this post


Link to post
Share on other sites

Are you running it as root?

Anyway, syncing "/" can backfire badly, even if you exclude /proc and whatnot.

For instance, your permissions and ownerships will be messed up.

Yes, as root. I want to ignore this folders with .SyncIgnore.

Share this post


Link to post
Share on other sites

Then it's probably an app limitation, for good reason. Seriously, don't do it.

New files in the home directories will belong to root, sensitive files could become readable for everyone and I can go on.

Of course you could try and mitigate this with ACLs but good luck with that on a system wide scale.

Share this post


Link to post
Share on other sites

I just want to backup maksimum files from my server and don't want to add each folder separately. Well, if so I'll add separately folders...

Share this post


Link to post
Share on other sites

One method you could use is to make a backup folder /BackUp and bind the folders you want to have backups to into that folder, then sync that folder...

Example...


mkdir /BackUp
cd /BackUp
mkdir opt var
mount -o bind /opt /BackUp/opt
mount -o bind /var /BackUp/var

Not sure if this would work as I have not tested it myself but it should be one option -- also if it does work and you do like how it turns out -- you just need to edit /etc/fstab to make the folders bind on boot. Again you will run into permission issues if another computer adds files.

So another option would be to have a cronjob to archive the files you want to protect and have the outputted archive go to the BackUp folder.

Share this post


Link to post
Share on other sites

If you only want backup and not synchronization you should use a backup/archiving program like unison or duplicity, either directly to a remote location or to a local directory and you can sync that. This also gives you the option to restore symlinks, permissions, ownerships or even ACLs.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.