You are not logged in.

#1 2019-01-24 14:26:36

S7.L
Member
Registered: 2018-09-16
Posts: 338

Gnu Stow

I tried this out today as i want to do it as form or backup of certain files, it seems to work ok, bit trick to figure out in regards to whole directories from $HOME but below seems to work.

https://www.gnu.org/software/stow/

Here is what i did.

mkdir -p dotfiles/test
mv $HOME/bin $HOME/dotfiles/test
cd $HOME/dotfiles
stow test

Anyone use something like this, i hear its popular for dotfiles via github/lab etc?

Also apparently there is a backup function you can use with gnu mv but i am a bit confused how this works?

Last edited by S7.L (2019-01-24 14:28:40)

Offline

#2 2019-01-24 14:53:43

earlybird
ほやほや
Registered: 2015-12-16
Posts: 710
Website

Re: Gnu Stow

I used to use stow for putting custom builds (from Makefiles) into /usr/local/.stow/$software-$version and then stow-ing them into /usr/local. I'm no longer using any overcomplicated scheme in my HOME because the point there is to keep things as simple as possible.

All of /home is backed up and can be restored as a whole, in one piece. I also used to have my dotfiles in a public git repo but since then I've started putting lots of private things and shortcuts in there, do not care about managing my privacy by actively having to keep these changes out of git and do not care about changes to the configs themselves because I edit all of them in vim, in which I have enabled infinite and persistent undo which stores all changes ever to the files made in vim on disk; that suffices to fix things after I broke them.

On my Arch system, when I need custom software, I just quickly create packages for it and push it to the AUR, the same means a world of pain on Debian too this day.

I think stow had its heyday during the days when you used to use a lot of locally compiled software and put it in /usr/local or /usr. Nowadays, the same is solved by systems such as Gentoo's EBUILD, Arch's PKGBUILD, and other ports systems in a more simple and centralized way. The problem of stowed software used to be that the system package manager wouldn't know about it.

stow is a symlink manager for those who need it. One thing I used it for was in a big monorepo at my company where multiple modules resided in the same tree and needed headers from each other to symlink the current headers from each module into the others.

Offline

#3 2019-01-24 15:16:40

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: Gnu Stow

^ i see, thanks. I probably wouldnt be using it for very much, seems like a nice idea to backup dotfiles to github/gitlab though. I rysnc $HOME to an external drive but to make life easier between a few computers or to share dots this stow seems pretty good when you make running changes and then git push.

Offline

#4 2019-01-24 16:40:05

S7.L
Member
Registered: 2018-09-16
Posts: 338

Re: Gnu Stow

figured out how to mv and backup files at the same time.

cp foo.txt{,.bak} && mv foo.txt ~/bin

For some reason my system the mv --backup does not work or im not using it properly, by say

mv -b foo.txt ~/bin

it doesnt leave a backup at all, it should leave a backup with a tilde on the end.

Offline

#5 2019-01-24 20:14:31

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 643

Re: Gnu Stow

^Actually, the '-b' options will make backup in case destination file already exists (before moving it).

For example

mv -b foo.txt ~/bin

should make backup file '~/bin/foo.txt~' only in case file '~/bin/foo.txt' existed before you issued above 'mv' command.

Last edited by iMBeCil (2019-01-24 20:14:45)


Postpone all your duties; if you die, you won't have to do them ..

Offline

Board footer

Powered by FluxBB