Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use unison to synchronize only dotfiles and dotfolders?

I would like to synchronize only files and folders that start with a dot in my home folder.

More specifically, I only want to synchronize the files and folders listed by:

ls -ld ~/.[^.]*

Unison command line I tried:

unison /home/username /backup/dotfiles -ui text -perms 0 -ignorenot 'Regex .[!.]*' -ignore 'Regex *[!.]'

gives the error:

Malformed pattern "Regex *[!.]".

This is a simplified example, and it would be reasonable to do this with rsync instead, but I would like to use unison because in my real use case I need bidirectional sync.

like image 733
user2387707 Avatar asked Nov 30 '25 15:11

user2387707


1 Answers

The regex syntax you're looking for is

"^.[^.]*"
like image 104
olejorgenb Avatar answered Dec 02 '25 06:12

olejorgenb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!