dooblem/bsync

What is the format of the .bsync-ignore file?

Closed this issue · 4 comments

I'm trying to remove folders called node_modules and .npm from my backup. However bsync always wants to copy them across?!

Especially keen to know please, can I use:

# for comments?
$ and ^ for start and end of line like in regex?
? for a single char random
* for any char random in this path?
/ naturally this delimits the directories. or does it?

Here is my .bsync-ignore file, which seems to half work:

nginx/fastcgi.conf
nginx/fastcgi_params
nginx/koi-utf
nginx/koi-win
nginx/mime.types
# nginx/nginx.conf <----- this is the file we want!
# nginx/proxy_params <----- this is the file we want!
nginx/scgi_params
nginx/uwsgi_params
nginx/win-utf


proc
.meteor/*
snort
.npm/*
node_modules/*
/home/cc/.*
/home/cc/crowdcourier/.*
/home/cc/crowdcourier/app/.*
crowdcourier/.*

# ROOT OF FILE SYSTEM ################

# root
bin
boot
dev
# etc
home
initrd.img
initrd.img
lib
lib64
lost+found
media
mnt
opt
proc
root
run
sbin
snap
srv
sys
tmp
usr
var
vmlinuz
vmlinuz.ol
webmin-set


# CHEESE FILES
anacrontab
appstream.conf
bluetooth
anacrontab
appstream.conf
bluetooth
brlapi.key
brltty
brltty.conf
catdocrc
chatscripts
cracklib
cryptsetup-initramfs
cups
cupshelpers
$dconf
doc-base
drbl
fstab-backup
fstab-hot
fstab-main-system
fwupd
fwupd.conf
gconf
gdb
gdm3
geoclue
ghostscript
grub-customizer
hddtemp.db
hp
ifplugd
ImageMagick-6
java-8-openjdk
kde4rc
kerneloops.conf
ksysguarddrc
kubuntu-default-settings
libao.conf
libpaper.d
libreoffice
lintianrc
menu-methods
mpd.conf
mtools.conf
netplan
netscsid.conf
nilfs_cleanerd.conf
PackageKit
papersize
pcmcia
pnm2ppa.conf
python3.6
sddm
signon-ui
speech-dispatcher
sudoers
sudoers.dist
sysstat
thunderbird
timidity
usb_modeswitch.conf
usb_modeswitch.d
whoopsie
wildmidi
wodim.conf
wpa_supplicant
xfe


# DOTFILES
.java/
.swp

# files
popularity-contest.conf
mailcap.order
group
legal
ld.so.conf
nsswitch.conf
wgetrc
shadow-
mke2fs.conf
os-release
lsb-release
gshadow-
apg.conf
updatedb.conf
magic
ca-certificates.conf.dpkg-old
insserv.conf
mime.types
securetty
vtrgb
bmon.conf
locale.gen
bindresvport.blacklist
hdparm.conf
subgid-
mailcap
subuid
shadow
networks
iptables.up.rules
ucf.conf
subgid
rpc
qemu-ifup
modules
cczerc
ld.so.cache
login.defs
crypttab
passwd-
drirc
mtab
.bsync-snap-*
subuid-
passwd
gshadow
rmt
inputrc
pam.conf
.pwd.lock
protocols
localtime
resolv.conf
ethertypes
overlayroot.conf
at.deny
locale.alias
magic.mime
machine-id
vdpau_wrapper.cfg
services
ltrace.conf
group-
manpath.config
libaudit.conf
ip6tables.up.rules
qemu-ifdown
rc.local
list.txt
request-key.conf
timezone
gai.conf
popularity-contest.conf
adduser.conf
mailcap.order
kernel-img.conf
group
screenrc
crontab
profile
legal
ld.so.conf
debian_version
nsswitch.conf
wgetrc
issue.net
sos.conf
shadow-
mke2fs.conf
os-release
hostname
lsb-release
gshadow-
apg.conf
updatedb.conf
debconf.conf
magic
ca-certificates.conf.dpkg-old
insserv.conf
deluser.conf
mime.types
environment
securetty
fstab
vtrgb
issue
bmon.conf
locale.gen
bindresvport.blacklist
hdparm.conf
subgid-
mailcap
bash_completion
subuid
shadow
networks
iptables.up.rules
ucf.conf
subgid
rpc
qemu-ifup
modules
sysctl.conf
cczerc
ld.so.cache
login.defs
logrotate.conf
crypttab
passwd-
drirc
mtab
subuid-
passwd
gshadow
rmt
inputrc
bash.bashrc
pam.conf
rsyslog.conf
.pwd.lock
protocols
sensors3.conf
ca-certificates.conf
localtime
zsh_command_not_found
.bsync-snap-20180410221645.364918
resolv.conf
ethertypes
overlayroot.conf
at.deny
locale.alias
magic.mime
machine-id
vdpau_wrapper.cfg
files.txt
services
ltrace.conf
group-
manpath.config
libaudit.conf
nanorc
ip6tables.up.rules
fuse.conf
host.conf
qemu-ifdown
rc.local
request-key.conf
timezone
gai.conf


# DIRECTORIES

at-spi2
network
terminfo
init.d
vim
iscsi
rc5.d
ppp
dnsmasq.d
firefox
request-key.d
xml
polkit-1
rc1.d
mysql
sane.d
init
systemd
apport
xdg
fonts
gtk-3.0
sysctl.d
lvm
pm
insserv.conf.d
kernel
ufw
dictionaries-common
modules-load.d
samba
cron.monthly
rcS.d
esound
skel
UPower
sensors.d
gss
ldap
console-setup
calendar
gtk-2.0
byobu
logrotate.d
python3.5
binfmt.d
libnl-3
apparmor.d
dpkg
ca-certificates
vmware-tools
sasl2
apache2
cron.weekly
cron.hourly
depmod.d
udisks2
pulse
texmf
groff
zsh
tmpfiles.d
python
python2.7
rc3.d
rc2.d
insserv
rsyslog.d
ssl
update-motd.d
selinux
rc0.d
acpi
cron.d
lighttpd
resolvconf
libvirt
apparmor
pam.d
initramfs-tools
pki
X11
apt
python3
default
docker
sgml
NetworkManager
dhcp
grub.d
emacs
openal
ssh
webmin
apm
bash_completion.d
modprobe.d
mdadm
dkms
sudoers.d
update-manager
kbd
logcheck
cron.daily
lynx
security
rc4.d
opt
mplayer
udev
avahi
rc6.d
profile.d
newt
dbus-1
iproute2
ld.so.conf.d
gnome
update-notifier
alternatives
dnsmasq.d-available
perl

Hello @tomachinz ,

The ignore file has to be very simple. No comments, just path prefixes.

https://github.com/dooblem/bsync/blob/master/bsync#L311

thanks, its working much better after removing all comments! i'm also gonna refrain from syncing / and do /etc, /root, and /home separately in a script, its working very nicely in a more minimal setup.

To summarise:

  • each line is only a substring to mask out files/dirs
  • short lines risk masking unintentionally as substrings of different files, this can be prevented by putting more of the path into the ignore file
  • don't use any special chars especially not comments, no wildcards
  • relative path only

Added a clarification in the readme.

Cheers dude! My revised .bsync-ignore is now

~
.idea
.part
.crdownload
.swp
.DS_Store
.Spotlight-V100
.Trashes
._
.sync
.bts
.!Sync
.SyncID
.SyncIgnore
.SyncArchive
.SyncPart
.SyncTemp/
.SyncOld
desktop.ini
ehthumbs.db
Thumbs.db
@eaDir
node_modules/
bundle/
build/
.tar.gz
DELETEME/
.meteor/local
bundle/
build/