Reputation
221
Top tag
Next privilege 250 Rep.
View close votes
Badges
1 9
Newest
 Promoter
Impact
~59k people reached

Apr
12
revised Bash command help to “search and replace” file in changing directory tree
Auto awarded deserves some explantion because the answers were really all fantastic
Apr
10
comment Bash command help to “search and replace” file in changing directory tree
OK! Initialize in step 1. Step 2 creates our working environment. Do some work in step 3 in the new working directory 'dir' & keep the previous (rolling working) directory 'dir.old'. Then in step 4+5 we set up the rsync with name swapping, then rsync to dst, clean up, &, properly, repeat step 2 to setup a new working environment. Rather than doing what I was suggesting (find the place in the file structure on dst where an updated file replaces a backup), you're rsync-ing the (hardlink) structure in which is located the one updated file. It's fast because of hardlinks. Yes?
Apr
10
comment Bash command help to “search and replace” file in changing directory tree
I have a short time to decide who will win this award. There are two key points to my bounty which I feel I've best expressed in my response to css1971 pseudo code solution. I feel your answer operates similarly between two directories and not a file and a directory, but you get extra points for actually providing code, which addresses the second aspect of this problem--time. Commandline solutions, and I would include bash scripts, are quick to implement, and perform one task quickly.
Apr
10
comment Bash command help to “search and replace” file in changing directory tree
I like the description of this package. Unfortunately it's more of a complete solution to the problem rather than the workflow or commandline fix I was hoping to get with this bounty.
Apr
10
comment Bash command help to “search and replace” file in changing directory tree
@css1971, I was hoping you'd have a response to my comment before the time limit to the award is over...(>_<)
Apr
10
comment Bash command help to “search and replace” file in changing directory tree
Lastly, I don't understand why the rsync step has dir.work directory, as this directory doesn't exist in this scenario. And I've not seen any examples of rsync taking three arguments. The man page shows source and destination. What's the third location (and --no-inc-recursive doesn't take an argument)?
Apr
10
comment Bash command help to “search and replace” file in changing directory tree
The intuition of the flat version is simple--it prevents duplicates to sync two flat dirs. I like that you say this solves my structure concerns. But, just to be clear, what is the intuition behind the 'swaps'? Since this is a workflow (and not a script) it's helpful to not miss a step.
Apr
9
comment Bash command help to “search and replace” file in changing directory tree
Just to be clear, this is an rsync between a flat dir of hardlinks (let's call it the client) to another flat dir of hardlinks (call it the archive) both of which I make on the fly whenever I need to backup?
Apr
9
comment Bash command help to “search and replace” file in changing directory tree
What's lost here is a commandline-fu option is not a complete solution, as rsync, bash script, or DMS would be. The latter solutions sync all files between source dir and destination dir. The commandline-fu should only save one file at a time to a destination dir! The context is I'm working on some research for a week and I have a few docs/pdfs which I've altered and need to backup on the remote archive. The crisis is I have no time. My wish is for some fu to back up one file without making copies on my archive. It's not a 'solution' but a workflow.
Apr
9
comment Bash command help to “search and replace” file in changing directory tree
I worked on this for several hours. First, I like this solution because it structures the way I can work with files in a very explicit way. I'm confused slightly with the workflow you propose. I've heard of hardlinks used in backups, particularly as permitting a changing structure in one dir pointing to a flat dir which is rsynced (correct me if I'm wrong). So what I'm saying is I'm not sure which directory I'm working in.
Apr
3
awarded  Promoter
Mar
20
accepted How many authorized_keys can/should be set up in SSHD?
Mar
20
revised Bash command help to “search and replace” file in changing directory tree
make the question more explicity about commandline-fu
Mar
12
revised Bash command help to “search and replace” file in changing directory tree
removed rsync from title as confusing the issue
Mar
12
comment Bash command help to “search and replace” file in changing directory tree
Actually, I was hoping for some commandline-fu, but I'm having trouble finding this myself because of the search similarity to search and replace in-file, rather than in-directory.
Mar
5
comment Bash command help to “search and replace” file in changing directory tree
I did think about version control software, but that's more of a long term solution (and I think git is only for text, but here's someone else's solution using git on PDFs!).
Mar
5
comment Bash command help to “search and replace” file in changing directory tree
Sounds like you're describing a regular backup process where a script makes local/remote temp directories of hard links, performs rsync, then destroys the temp directories. I was thinking of a different scenario of maybe replacing 5 or so files at a time, so it seems inefficient to make a temp directory of the whole repo. Nevertheless that is a doable solution.
Mar
5
comment Bash command help to “search and replace” file in changing directory tree
I'm forced to maintain unique names. These are OP's research papers, and if I change the name, then, for example, I can't be sure I'm not reading something I've already read. The changes are typically annotations to PDFs, so it's also important to not reread something I've already read.
Mar
5
revised Bash command help to “search and replace” file in changing directory tree
edited title
Mar
5
asked Bash command help to “search and replace” file in changing directory tree