On 19/11/2020, o1bigtenor <o1bigte...@gmail.com> wrote:
> I am mostly a ham fisted operator when I'm working with the innards of
> linux.
> So I was trying to set up a symlink and managed to rm my ledger.dat file.
> The backup was at least 70 if not a lot more hours of work ago.
> rm is a very efficient file removal tool so I did waste some time on
> trying to recover the file but
> not too much. So to the question!

This is usually possible but terribly involved.  That's a lot to
loose.  Happens to us all now and again, I guess.

> So I took that last backup to my ledger.dat file but now, being
> properly totally paranoid, I want to save said file in at least 3
> discrete locations. I use a raid-10 array for most of my long term
> storage needs so getting to individual files there can easily take me
> some 8 to even 10 levels of directories.  I've looked at the parallel
> command but it seems to be quite a bit more for a parallel input(s) to
> parallel output(s) kind of thing. Found some reference to symlink
> chains but no real examples of such. Thought of trying to roll
> something in bash but my multi-level deep folders system put the
> brakes on that idea in a hurry.
>
> Does anyone here have any ideas, or has already implemented, on how to
> save something from a text editor to multiple locations
> simultaneously? (Please)

This is really intrinsic to your workflow (and other aspects of your
data storage and lifecycle) but you can be confident of finding a good
answer with standard tools.

'rsync' (or 'cpdup') is probably the correct tool here; neither make
multiple copies but simply copy if it has changed, you can also tell
them 'no delete' if you're worried about them replicating your 'rm'
too quickly.  If you wanted to integrate that with editing feature you
could, of course, use 'cron' to periodically copy whatever was on the
disk or inotify tools to copy every time you wrote to the file.  If
you're in and out the editor enough, a simple function that did ['cp'
or 'tar' after exiting] might also be adequate (see below for VERY
rough example).  If your editor does backup copies that might also add
to your confidence (i.e. grab the working directory and get the copies
and the current file).

'git' is an option (the idea that you must push to the cloud is
incorrect) you can simply have a local repository and commit, HOWEVER,
it is not a great backup option IMHO.  I would, however, recommend
using 'git' in addition to your auto-save requirements.

--
['cp' after exiting]: #1
# define a function that will be imported to our shell and thus
executable from command line
editor()
{
   ledger=$1
   ledger_file=`basename $ledger`
   /path/to/real-editor "$ledger"
   cp "$ledger" `mktemp -u "/safe/location/$ledger_file.XXXXX"`
}

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ledger-cli+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/CAHCf7OEPwPMKAMZO2x4BcR_LUqCYJmsvNpJM9d%2Bfi0yuZFUHxw%40mail.gmail.com.

Reply via email to