-
kerneldove
basically i'm looking for the correct way to copy (recursively) the contents of a dir into a new dir that doesn't exist yet. is it cp -R src/ dest ?
-
kerneldove
i'm reading that the most correct way is cp -R src/. dest
-
rwp
kerneldove, Love to love rsync as it is the swiss army knife of file copying. rsync -av src/ dst/ Put the trailing slash on both the src and dst directories! Very important.
-
rwp
That will make those two directories the same. If you want dst/src to be the result then rsync -av src/ dst/src/ and Bob's your uncle as the British say.
-
rwp
f451, The first time you benefit from having a Boot Environment then you fall in love with having Root on ZFS. Boot Environments ROCK!
-
kerneldove
i'm asking about cp not rsync ai slop
-
rwp
kerneldove, You think I am an AI? But I usually pass the Turing test! I even have a t-shirt with "I am not a robot" on it. (I do actually.)
-
kerneldove
no, rsync has become that
-
kerneldove
ya i know you've been in here forever
-
rwp
I know the author has started to vibe code but there is no evidence that the tool itself has been made bad yet.
-
kerneldove
ya cool i'm asking about cp
-
robert12
No. He has not started to vibe code. You should understand what 'vibe coding' is first.
-
rwp
For cp you might want to use cp -av src/ dst/ too. Basically the same rules apply.
-
robert12
'vibe coding' implies you have no understanding or care for what code is produced, you dont review it, you do everything through a prompt, im sure thats not the case with rsync.
-
rwp
I am sure that is not the case with rsync. Agreed. And I still like and use rsync.
-
kerneldove
cool so what's with cp -Rp src/. dest <-- the . after /
-
rwp
A lot of people object (also without thinking too much) about the license and are embracing OpenBSD's OpenRsync rewrite using the BSD license only because of the license change. I am sad about this because it is a lot of wasted effort and both are free software licenses.
-
rwp
If you don't say . then . is assumed. So src/ and src/. are equivalent. Same thing. The dot is explicit. Without the dot it is implicit.
-
robert12
I agree. For me, license forks are usually questionable. Altho I get that GPL is hard to buy into.
-
rwp
In the case of a symlink then things around symlinks can be somewhat subtle.
-
rwp
I don't see any cases where someone should fear the GPL. But that's a conversation for another time.
-
robert12
:)
-
rwp
In the case of a symlink foo -> bar then if you cp foo you copy the symlink. But if you copy foo/ or foo/. then you push through the symlink and copy the directory it is pointing at, in this case bar.
-
rwp
Putting the trailing foo/ forces it to be considered a directory, pushes through symlinks if it is a symlink.
-
rwp
In the case of a destination it avoids ambiguity.
-
kerneldove
rwp ya but -P is implied with -R
-
rwp
If dst does not exist then it is assumed to be inside the parent directory. Then src is put into the parent directory and the name is changed to dst. But if the directory already exists then it puts src into the dst directory. Putting a trailing slash on it avoids that ambiguity.
-
rwp
The -P applies to files that cp is listing and copying as part of the recursive copy. The symlink issue I describe are for program option-arguments.
-
kerneldove
trailing slash on "it" (the source or destination?)
-
kerneldove
my original question: basically i'm looking for the correct way to copy (recursively) the contents of a dir into a new dir that doesn't exist yet. is it cp -R src/ dest ? best i've found so far is cp -R src/. dest
-
rwp
Applies to both source and destination directories. Both are directories. Applies to directories.
-
kerneldove
ya but that's not what i asked about
-
rwp
If you don't know if dest exists, then if dest exists (and I am sure that at some point it might) then it will copy src into dest/src.
-
rwp
I think there are four cases in the logical truth table. Work through each of those four test cases and prove to yourself what happens in each of the cases. Then you will know for certain what happens in each of the cases. And then do it again with symlinks in play.
-
kerneldove
ok so coming back to original goal, what's the correct way to recursively copy contents of a dir into another dir that may or may not exist, creating it if it doesn't exist?
-
rwp
Not ghosting you but I must do something in real life. Later!
-
kerneldove
np cya
-
kerneldove
seems jails don't have /home by default?
-
rtprio
kerneldove: that depends on how they were created
-
kerneldove
?
-
kerneldove
but every jail needs to have /home created for it to have it no?
-
rtprio
why would it?
-
kerneldove
what
-
kerneldove
"depends on how they were created" go on
-
kerneldove
just expanding base for a new jail doesn't seem to have a /home dir
-
rtprio
so `mkdir /home` if you have a user that needs it
-
rtprio
but it's merely convention to have it all
-
kerneldove
wow all that in response to "seems jails don't have /home by default?" when you coulda just said "yes"
-
kerneldove
weird waste of your own time
-
kerneldove
so i set up this jail to accept ssh connections, i try to ssh in, says pty allocation request failed on channel 0?
-
kerneldove
ah looks like devfs
-
nesta
lol
-
kerneldove
sup
-
supaplex
is there something I need to change in my kernel config to boot zfs okay? I know GENERIC has zfs support, but it's acting quite the opposite.
github.com/supaplextor/tech-bucket/blob/main/FreeBSD-15/mountroot.md
-
kerneldove
ok ya devfs fixed it, can ssh into jail now
-
kerneldove
supaplex did you use the gui installer and pick auto zfs?
-
kerneldove
stock generic kernel has zfs support built in
-
supaplex
right, so include should pick that up.
-
kerneldove
you need some stuff in /boot/ loader and /etc/ for zfs, but the installer does all that
-
supaplex
I don't recall how I installed. it's been about 6 months
-
hodapp
supaplex: are you named after the famous DOS game?
-
supaplex
hodapp: yup
-
hodapp
:D
-
supaplex
hodapp: I think I got to about level 30ish and could not finish the game, but plenty of good memories around that game.
-
hodapp
I forget what levels I made it to
-
hodapp
my siblings and I all played it
-
supaplex
okay, so I built a kernel around GENERIC config (no changes), and after build and install and boot, I get the same error 45. FreeBSD 15.
-
nesta
supaplex: is your disk formatted as zfs?
-
kerneldove
is it always good to run zfs with the sysctl vfs.zfs.vdev.min_auto_ashift=12?
-
rtprio
i could answer but i don't want to waste my time
-
kerneldove
not petty at all
-
rtprio
i don't think you'd need ashift 12 if you have a real drive with 4k sectors
-
kerneldove
i thought ashift 12 was explicitly for modern drives 4k sectors?
-
nimaje
it doesn't really hurt when the sectors are smaller, at most a bit of space lost and pretty sure only acient drives have smaller sectors, "modern" is relative and 512e is just 4k sectors, but the drive firmware lies to you and then rewrites the 4k sector to change the 512 sector you have given it
-
kerneldove
so to be safe and consistent, why not always set vfs.zfs.vdev.min_auto_ashift=12 when using zfs?
-
nimaje
yeah, just set it, like the installer automatically does
-
nimaje
if you already have 4k sectors (and the drive firmware doen't lie) then zfs will use an ashift value of 12, as that is what the drive needs the min in min_auto_ashift means that it won't go lower even if the drive sector size would allow for it and I'm not sure about it being changeable after creating the pool, so it is for 512e drives, to avoid the performance hit from using those fake 512
-
nimaje
sectors and afaik also to have your pools future proof in case you start with real 512 drives, but add 4k drives later
-
f451
nimaje: it's definitely not changable. ashft is set at pool creation time
-
f451
to 'change' it you'd need to destroy the pool and recreate it
-
mosaid
freezmi: No, after akamai took over they send me every 2 months abuse tickets claiming my server is hacked
-
mosaid
talked about that here before.. I think I was really hacked using old mediawiki script.. I removed access to it, my site is nearly 100% static now
-
mosaid
used many antivirus for scan.. 0 malware, they now claim my server is been used for spam and brute force
-
mosaid
also no one hacked via ssh
-
mosaid
wait
-
mosaid
let chck
-
ananke
'I can't detect anything' is hardly a proof of 'it's not happening'. a misconfigured MTA has been historically one of the top culprits behind spam, and that has nothing to do with 'malware' or 'viruses'
-
mosaid
no no I think I find it
-
mosaid
squid proxy
-
mosaid
I was testing squid proxy few years ago on my host.. just wanted an USA ip, but then I lifted it there
-
ananke
heh. so you let the world proxy web traffic through your system, and you're surprised that it was used in malicious manner?
-
mosaid
forget it.. when I was checking for services now found it running.. I think there is some bots grapes those open proxy anonymous proxies and list for public.. this why
spys.one/en have some nice fresh ones
-
mosaid
also linode last 6 months have problems from those bots they took down nearly 50% of their data centers in last nov
-
mosaid
ai bots is real problem now days :( I don't know how they guessed the url..
-
mosaid
but weird they found the new ip after I changed it.. I didn't connect it to my domain
-
supaplex
nesta: yes
-
mosaid
my thoughts is real
ip2proxy.com/139.162.205.21 ... Fraud Score : 80 :O
-
mosaid
2TB of data monthly was passing through it
-
mosaid
good that I haven't been jailed
-
mosaid
ditatompel.com/proxy/asn/63949 my thoughts about akamai linode having problem with ai bots is also real.. my ip is listed there
-
nimaje
well, a ipv4 is only 32bit, scanning all ipv4 doesn't take that long
-
mason
s/hacked/cracked/ from earlier, fwiw
-
mosaid
beware guys form those bots.. and I know I am stupid, but this bots is getting better day after day of finding private services even if it have login they could break it.. like in and italian private email service I know
-
mosaid
*an
-
mosaid
many hosts now is suffering from them
-
mason
mosaid: This might be better fodder for #freebsd-social since it's not really about FreeBSD at all.
-
mosaid
Ok, I will no more talk about it.. just warned
-
freezmi
mosaid: just change the provider if akamai still sends you unsubstantiated abuse tickets
-
mosaid
no it's real ones
-
mosaid
but they suffer form bots attacks
-
mosaid
all hosts suffer from it
-
freezmi
you mean AI web scrapers?
-
mosaid
yeah.. but evil ones searches for exploits and private services.. open ports
-
freezmi
maybe it's time to follow a FreeBSD hardening guide :)
-
mosaid
ceck last Nov.. cloudflare down, linode data centers in asia down, azure DDOSed, etc..
-
mason
Still better to talk about this in #freebsd-social.
-
mosaid
wait ah wrong tab heh
-
mosaid
sorry
-
solstis
i'm curious: what do you use to monitor processes, used memory and other things- top, btop, htop or another tool ?
-
oxyhyxo
htop
-
oxyhyxo
top
-
oxyhyxo
systat
-
oxyhyxo
zpool iostat
-
Ozymandias42
htop is god-king of terminal monitors. it can show anything if you just configure it so
-
Ozymandias42
it can even show ZFS ARC statistics
-
boru
btop's pretty good, too
-
Ozymandias42
yeah but especially in virt setup nothing beats htop.
-
Ozymandias42
guest-cpu%, stolen cpu time (in guests for time stolen by other guests)
-
Ozymandias42
pressure stall information (PSI)
-
Ozymandias42
haven't seen any other tool that can show these
-
solstis
thank you, all
-
ke5c2fin
Can someone help me with the process of updating the version of a port? net-mgmt/yaf is at version 2.13.0 from Feb 2023 and I would like to update it to current 2.19.3, it builds fine from source but I would like to update the port
-
nimaje
ke5c2fin: update DISTVERSION and reset PORTREVISION then update distinfo via make makesum and try to build the updated port, when you got it to build in poudriere then open a problem report on bugs.freebsd.org
-
ke5c2fin
nimaje: thank you, I will try this. So far I have been using portmaster, can this be done via portmaster as well or should I familiarize myself with poudriere?
-
nimaje
for proper build isolation you should build with poudriere before creating a PR, but to get it working first I recommend make build directly in the ports tree, so that you only have to catch forgetten dependencies and problems with packaging via poudriere
-
ke5c2fin
Thank you, I will give this a shot.
-
supaplex