Re: Favorite configuration and system replication tools?

2024-05-14 Thread Walter Alejandro Iglesias
On Tue May 14 18:11:16 2024 Страхиња Радић wrote: > Antipatterns are bad. I don't mean the ellipsis in `ls -l ...`. I mean > things like > > cat file | grep hello | cat | sed 's/hello/world/g' | cat - > output > > for file in `echo `ls *` `; do echo $file; done > > ls -l | awk '{ print $5

Re: Favorite configuration and system replication tools?

2024-05-14 Thread Страхиња Радић
Дана 24/05/14 11:52AM, Walter Alejandro Iglesias написа: > I learned about the convenience of adding the '-r' option in the "while > read" loop many years ago when I was writing a script to convert roff to > html, the problem aroused with the backslash in roff comments (.\"). That's more or less

Re: Favorite configuration and system replication tools?

2024-05-14 Thread Walter Alejandro Iglesias
On Tue May 14 11:11:33 2024 wrote: > When `while ... read ...` idiom is used, it is advisable to clear IFS > to turn off field splitting, and use -r to avoid interpretation of > backslash sequences in the input: > > while IFS= read -r dir; do # ... > > Back to parsing the output of ls(1)

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis
Andreas Kähäri writes: i'm not sure why you're addressing this to me, as i'm not the OP. It's addressed to the thread in general. Your response quoted me, then made use of the word 'you'. Which you - and yes, i mean you, Andreas, specifically - have again done below: That said, yes,

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 21:50:12 2024 Martin Schröder wrote: > > If a line begins with "- " (dash, space) or "+ " (plus, space), > then the type of rule is being explicitly specified as an exclude > or an include (respectively). Any rules without such a prefix are > taken to be an include. I'd

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Martin Schröder
Am So., 12. Mai 2024 um 21:18 Uhr schrieb Walter Alejandro Iglesias : > On Sun May 12 20:58:43 2024 Andreas Kähäri wrote > > With rsync(1): > > > > rsync -n -aim --delete-excluded \ > > --include-from=list \ > > --include='*/' \ > > --exclude='*' \ >

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 20:58:43 2024 Andreas Kähäri wrote > With rsync(1): > > rsync -n -aim --delete-excluded \ > --include-from=list \ > --include='*/' \ > --exclude='*' \ > source/ target > I don't understand what your command does exactly.

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Chris Bennett
On Sun, May 12, 2024 at 01:40:25PM +0200, Walter Alejandro Iglesias wrote: > > Unix development. Given that i've been using computers for a few > > decades, i still instinctively don't use spaces in filenames, even > > though they're very much allowed. But of course, that's not what > > most of

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis
Andreas Kähäri writes: The external env(1) utility will only ever list environment variables. The IFS variable does not need to be exported as an environment variable as it's only ever used by the current shell (and any new shell would reset it). To list all variables in a shell, use the

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis
Страхиња Радић writes: Дана 24/05/12 07:31PM, Alexis написа: Omitting -r as a parameter to read would make it interpret backscape sequences, which would make the directory name in the filesystem different than the one command/script operates on, which is most likely undesired (unless the

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Страхиња Радић
Дана 24/05/12 07:31PM, Alexis написа: > i wondered about that in this context. If people putting odd / inappropriate > things in directory names are a concern ("weird characters", as you wrote > upthread), what do we do about the possibility of someone having consciously > put e.g. a \t in a

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Andreas Kähäri
On Sun, May 12, 2024 at 08:08:17PM +1000, Alexis wrote: > Andreas Kähäri writes: > > > Well, that's one way to control this trainwreck of a script; just say > > that any name containing "inappropriate" characters aren't allowed! > > > > May I ask why you don't simply use rsync(1) (or even

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Andreas Kähäri
On Sun, May 12, 2024 at 07:56:55PM +1000, Alexis wrote: > Andreas Kähäri writes: > > > The ksh(1) shell sets IFS by default to a space, tab and a newline > > character. > > Those are the defaults used when IFS is not set _as a variable_. If you log > in, and run env(1), in the absence of any

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 13:22:13 2024 Alexis wrote: > Andreas Kähäri writes: > > Well, that's one way to control this trainwreck of a script; > > just say > > that any name containing "inappropriate" characters aren't > > allowed! > > > > May I ask why you don't simply use rsync(1) (or even > >

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Andreas Kähäri
On Sun, May 12, 2024 at 07:31:41PM +1000, Alexis wrote: > Страхиња Радић writes: > > > When `while ... read ...` idiom is used, it is advisable to clear IFS to > > turn off field splitting > > *nod* Fair point; it's not set by default, so i didn't think to note that > any manual setting of it

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 11:40:05 2024 tux2bsd wrote > Hi Walter > > mktemp makes temporary unique filenames like this: > > delete_list=$(mktemp) > source_list=$(mktemp) > target_list=$(mktemp) > # Do your code. If you want to keep something you do > # that appropriately then: > rm $delete_list

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis
Andreas Kähäri writes: Well, that's one way to control this trainwreck of a script; just say that any name containing "inappropriate" characters aren't allowed! May I ask why you don't simply use rsync(1) (or even openrsync(1) from the OpenBSD base system)? i'm not sure why you're

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis
Andreas Kähäri writes: The ksh(1) shell sets IFS by default to a space, tab and a newline character. Those are the defaults used when IFS is not set _as a variable_. If you log in, and run env(1), in the absence of any manual setting of IFS in .kshrc or whatever, you'll see that IFS is

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis
Страхиња Радић writes: When `while ... read ...` idiom is used, it is advisable to clear IFS to turn off field splitting *nod* Fair point; it's not set by default, so i didn't think to note that any manual setting of it should be overridden for this. and use -r to avoid interpretation of

Re: Favorite configuration and system replication tools?

2024-05-12 Thread tux2bsd
> What about the following, better? > > - > # Remove files from target directory > date=$(date +%H%M%S) > delete_list=/tmp/delete_$date > source_list=/tmp/source_$date > target_list=/tmp/target_$date Hi Walter mktemp makes temporary unique filenames

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Страхиња Радић
Дана 24/05/12 06:17PM, Alexis написа: > To deal with spaces etc., one could possibly use something along the lines > of the following kludge; it assumes that \n is relatively unlikely to be > found in a directory name, and that the directories in $dirs can be > separated by \n. > > cd "$target"

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Walter Alejandro Iglesias
On Sun May 12 10:07:30 2024 Страхиња Радић wrote: > A few notes: > > - You don't need a backslash after a pipe (|) or a list operator (|| > and &&) - a line ending with a pipe is an incomplete pipeline. So > (with added quoting): > > diff "$source_list" "$target_list" | > awk '/^> /

Re: Favorite configuration and system replication tools?

2024-05-12 Thread Alexis
Страхиња Радић writes: Lapsus: the variable dirs should not be quoted here if it contains more than one directory to be passed to find. It is vulnerable to directory names containing spaces and weird characters, however. So: cd "$target" && find $dirs | sort | uniq >

Re: Favorite configuration and system replication tools?

2024-05-11 Thread Страхиња Радић
Дана 24/05/11 10:36PM, Страхиња Радић написа: > cd "$target" && > find "$dirs" | sort | uniq > "$target_list" Lapsus: the variable dirs should not be quoted here if it contains more than one directory to be passed to find. It is vulnerable to directory names containing spaces and weird

Re: Favorite configuration and system replication tools?

2024-05-11 Thread Страхиња Радић
Дана 24/05/11 07:41PM, Walter Alejandro Iglesias написа: > Today I realized that the loop above is not necesary: > > --- > dirs=$(echo "$files" | grep '/$') > > cd && find $dirs | sort | uniq > $source_list > cd $target && find $dirs | sort

Re: Favorite configuration and system replication tools?

2024-05-11 Thread Walter Alejandro Iglesias
On Sat May 11 20:20:04 2024 "Robert B. Carleton" wrote: > Another tool you might want to take a look at is rdist(1). It's limited > in some ways, but is a native capability to OpenBSD. It has a long > history. > I've never used rdist(1) either, I will learn about it. Thanks Robert for mention it

Re: Favorite configuration and system replication tools?

2024-05-11 Thread Robert B. Carleton
Walter Alejandro Iglesias writes: > On Fri May 10 08:36:50 2024 Walter Alejandro Iglesias wrote >> Then I do something like this (simplified for clartiy): >> >> [...] >> >> dirs=$(echo "$files" | grep '/$') >> >> for i in $dirs ; do >> find $source/$i | sed 's#'$source'##' | sort | uniq >

Re: Favorite configuration and system replication tools?

2024-05-11 Thread Walter Alejandro Iglesias
On Fri May 10 08:36:50 2024 Walter Alejandro Iglesias wrote > Then I do something like this (simplified for clartiy): > > [...] > > dirs=$(echo "$files" | grep '/$') > > for i in $dirs ; do > find $source/$i | sed 's#'$source'##' | sort | uniq > $source_list > find $target/$i | sed

Re: Favorite configuration and system replication tools?

2024-05-10 Thread Walter Alejandro Iglesias
On Fri May 10 08:16:32 2024 "Robert B. Carleton" wrote: > I'm going to try using pax(1) in copy mode (-rw) as an alternative to > rsync and cpio when it's local filesystems. I hadn't considered that > until recently. This is my dirty solution to add pax a "delete on target" functionality. I

Re: Favorite configuration and system replication tools?

2024-05-08 Thread Raymond, David
Rsync. I also have a root directory in /home to keep local stuff. This is the same for about 20 machines running obsd and is also distributed by rsync. Since it is in home, it survives upgrades. Various shell scripts in /home/root/etc are used to manage the system. On Wed, May 8, 2024, 11:08

Re: Favorite configuration and system replication tools?

2024-05-08 Thread Jan Stary
On May 07 22:15:27, olp...@yahoo.ca wrote: > I was wondering which programs you use for replicating/copying/syncing > environments/configs on your openbsd systems with between your desktops (home > or work) and laptops? git > Do you also maintain installeded/removed packages in some standard

Re: Favorite configuration and system replication tools?

2024-05-08 Thread Fernando Milovich
duplicity On 2024-05-07 9:09 p.m., Matthew Ernisse wrote: On Wed, May 08, 2024 at 12:25:43AM +0100, Jo MacMahon said: I'm interested if anybody has solutions using just the base system I've had a set of functions in my .profile for about 15 years that keeps large parts of my home directory

Re: Favorite configuration and system replication tools?

2024-05-07 Thread Nick Holland
On 5/7/24 19:25, Jo MacMahon wrote: I'm interested if anybody has solutions using just the base system - I would want something like etckeeper or git that was a true version control system, rather than dump(8)/restore(8) which are backup systems. I'm idly considering learning CVS for it, and

Re: Favorite configuration and system replication tools?

2024-05-07 Thread Matthew Ernisse
On Wed, May 08, 2024 at 12:25:43AM +0100, Jo MacMahon said: I'm interested if anybody has solutions using just the base system I've had a set of functions in my .profile for about 15 years that keeps large parts of my home directory available and in sync across Linux, macOS and OpenBSD

Re: Favorite configuration and system replication tools?

2024-05-07 Thread Jo MacMahon
I'm interested if anybody has solutions using just the base system - I would want something like etckeeper or git that was a true version control system, rather than dump(8)/restore(8) which are backup systems. I'm idly considering learning CVS for it, and I suppose if I'm going to become a

Re: Favorite configuration and system replication tools?

2024-05-07 Thread Mario Theodoridis
On 07.05.2024 16:08, Martin Kjær Jørgensen wrote: Hello, I was wondering which programs you use for replicating/copying/syncing environments/configs on your openbsd systems with between your desktops (home or work) and laptops? Example programs for this could be syncthing, stow, chezmoi,

Re: Favorite configuration and system replication tools?

2024-05-07 Thread Robert B. Carleton
Stefan Moran writes: > dump(8) and restore(8) also worth mentioning; I'm particularly fond of > restore(8)'s interactive mode that lets you cherrypick what you want to > import. I agree. My backups are mostly dump(8) and rsync(1). Out of habit, I've used cpio(1) in copy mode (-p) for copying

Re: Favorite configuration and system replication tools?

2024-05-07 Thread olp_76
rdist On Wednesday, May 8, 2024 at 12:25:13 a.m. GMT+9, Martin Kjær Jørgensen wrote: Hello, I was wondering which programs you use for replicating/copying/syncing environments/configs on your openbsd systems with between your desktops (home or work) and laptops? Example programs

Re: Favorite configuration and system replication tools?

2024-05-07 Thread Ian Darwin
On 5/7/24 1:09 PM, Страхиња Радић wrote: Дана 24/05/07 04:08PM, Martin Kjær Jørgensen написа: I was wondering which programs you use for replicating/copying/syncing environments/configs on your openbsd systems with between your desktops (home or work) and laptops? git(1), rsync(1). git push

Re: Favorite configuration and system replication tools?

2024-05-07 Thread Stefan Moran
dump(8) and restore(8) also worth mentioning; I'm particularly fond of restore(8)'s interactive mode that lets you cherrypick what you want to import.

Re: Favorite configuration and system replication tools?

2024-05-07 Thread Страхиња Радић
Дана 24/05/07 04:08PM, Martin Kjær Jørgensen написа: > I was wondering which programs you use for > replicating/copying/syncing environments/configs on your openbsd > systems with between your desktops (home or work) and laptops? git(1), rsync(1).

Favorite configuration and system replication tools?

2024-05-07 Thread Martin Kjær Jørgensen
Hello, I was wondering which programs you use for replicating/copying/syncing environments/configs on your openbsd systems with between your desktops (home or work) and laptops? Example programs for this could be syncthing, stow, chezmoi, etc. Do you also maintain installeded/removed packages