Finally managed to fix an annoying problem whereby Nextcloud was sometimes running twice on one of my machines, and had double-downloaded every file (but not uploaded them, so my desktop had two copies of everything but the server didn't, and the duplication only happened on one account). This used up 8GB of space!
I will blog about it at some point, but the root cause was Nextcloud was listed to launch twice at startup, although it only did maybe 10% of the time. (1/2)
[#]Linux #Nextcloud
=> More informations about this toot | More toots from pwaring@fosstodon.org
The command I ran to remove the duplicates was:
find . -name '..~' | xargs -d '\n' rm
The -d '\n' argument to xargs tells it to only use newlines to separate paths, otherwise it tries to use any whitespace and this breaks when you have paths with spaces in them. (2/2)
=> More informations about this toot | More toots from pwaring@fosstodon.org
@pwaring you can also tell find to -delete
=> More informations about this toot | More toots from jmtd@pleroma.debian.social
@jmtd Good point, I'd forgotten about that (some of my server backup scripts use -delete).
=> More informations about this toot | More toots from pwaring@fosstodon.org
@pwaring The easy no-brainer way to do that escape thing is:
find -print0 | xargs -0
This will also work on filenames with newlines in them which are valid on *nix but not common.
=> More informations about this toot | More toots from diffrentcolours@tech.lgbt
@diffrentcolours @pwaring At least with GNU f}nd the "-delete" operation may be easier:
find -name whatever-pattern -delete
Run first without -delete to make sure you have the right pattern for the name.
=> More informations about this toot | More toots from liw@toot.liw.fi
@pwaring safer, imo, is `find ... -print0 | xargs -0 ...' which ensures paths are 0-terminated
edit: and find can delete itself (which I always forget because #oldfart)
=> More informations about this toot | More toots from jpmens@mastodon.social This content has been proxied by September (3851b).Proxy Information
text/gemini