[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Copy/migrate archives/history with a new key?



I *literally* ran this by mistake:

tarsnap -c -f "new-prefix_test" @@Job_most-essential-files_2025-07-08_10-00-08
	--print-stats \ 
	/usr/local/etc/ /path/exclude.pattern.file \ 
	-v --dry-run

Instead of '--exclude pattern' I was trying to use '-X file'. 
I messed up — accidentally overwrote the -X flag with a random folder path
copy-pate, followed by a non-existent example path. So looks -v or --dry-run 
weren’t even picked.

In output I only saw reconnection attempts as Internet had indeed 
disconnected. 

Changes were made on the server, and a "new-prefix_test" archive 
indeed was created. Verified with 'tarsnap --fsck'.

I had saved the full file list for each archive (in separate text files), and 
also output of "tarsnap --print-stats -f '*'".


So I matched them after my mishap:

- Job_most-essential-files_2025-07-08_10-00-08: list of files in the archives
are exactly same before and after - Job_most-essential-files_2025-07-08_10-00-08
sizes before:
  Job_most-essential-files_2025-07-08_10-00-08    841 MB        783 MB
  (unique data)                                   5.0 MB        1.7 MB

- Job_most-essential-files_2025-07-08_10-00-08 sizes after (unique data
decreased):
  Job_most-essential-files_2025-07-08_10-00-0     841 MB        783 MB
  (unique data)                                   890 kB        288 kB

- new-prefix_test: its list of files is much smaller than the source archive. 
But when I compared the file list they match exactly until new-prefix_test file ended. 
As you see there is no ".part" in its name. 
  new-prefix_test                                 36 MB         15 MB
  (unique data)                                   205 kB        37 kB

I might break something further so I have not run anything else.
Thought I will check here first.


======================


Will this command work (fixed, afaicu, version of what I actually ran)?:

tarsnap -c -f "new-prefix_test" @@oldarchive
	--print-stats \ 
	-X exclude.txt \ 
	-v --dry-run

Are the orders of args fine? Or should @@oldarchive be moved to the end after
every arg has been passed as it was in your example?

And from the 'tips' docs page it looks like my 'excludes.file' should look like
this?:

-----
._*
.DS_Store
*.png *.PNG Library
.git
.dotfiles
Some Folder (ab-xyz)
-----

Given I wanted to exclude/filter out these files/folders: 
- file names starting with: ._ 
- .DS_Store files; .png/.PNG files 
- and these folders anywhere: Libray; .git"; .dotfiles; "Some Folder (ab-xyz)"


Also: tarsnap-gui appends "Job_" as "Job_{job name}_{timestamp}" to every
archive name. Can I choose not to add that "Job_" or decide on my own how to
name the archive while still using the GUI?