Date: Sat, 11 Apr 2020 10:31:48 +0200 From: Andrea Venturoli <ml@netfence.it> To: David Christensen <dpchrist@holgerdanske.com>, freebsd-questions@freebsd.org Subject: Re: Restoring and snapshots Message-ID: <dbe79517-3d72-3af9-48df-129c7ec89bf7@netfence.it> In-Reply-To: <e8fb0530-917a-f259-9238-5306e63b89df@holgerdanske.com> References: <56b4e678-0e66-e65b-b9d2-a2e79a5b7b6f@netfence.it> <e8fb0530-917a-f259-9238-5306e63b89df@holgerdanske.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2020-04-11 01:53, David Christensen wrote: > ZFS can roll back a filesystem per a snapshot. See zfs(8) 'rollback'. I know, but this is not the point of my question. Probably I've not been that clear: let's suppose I'm restoring data from a ZFS system on a non ZFS filesystem. I just have plain files and I have to deal with that. > The ZFS analog of dump(8) is 'zfs send' and the ZFS analog of restore(8) > ... Again, I know, I'm using that in other situations, but this is not the case. > I am not sure I understand what you mean by "directories which must > overlap" (?). For example, after restore, I have: .../usr/jails/.zfs/snapshot/snapname/dc/ and .../usr/jails/dc/.zfs/snapshot/snapname/ (This is a result of ezjail use of nullfs). So (in my script) I cannot simply "mv" directories around, but sometimes I need to "merge" them. > The numerous shells and languages each have their own idiosyncrasies > when it comes to spaces in file and directory names. While I avoid whitespaces in filenames, my users unfortunately won't (including very creative things, like spaces at the beginning or end). > The key concept is that each path component needs to be preserved as a > single unit, and not broken into pieces if it contains spaces. Ok. The real problem, when writing my script, is that I end up looping over results of `ls ...` or `find ...`. I read that is considered bad practice, so I asked if, maybe, there was a better way. Up to now, it seems not... I'm wondering if I should abandon sh and use something else (Python?). bye & Thanks av.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?dbe79517-3d72-3af9-48df-129c7ec89bf7>