Debian 12 Trying To Back Up Hidden Config's [Solved]

Alexzee

Well-Known Member
Joined
Jun 1, 2019
Messages
3,590
Reaction score
1,911
Credits
21,193
Following this article I found online for copying hidden files.
I need to back up the hidden files in my /home directory. And specifically back up a Gimp configuration file (sessionrc) that keeps the docks in place.


Never tried this before. The command-line is barking about the destination file and that it's missing:-

Code:
@debian-box:~$ cp app/.*backup
cp: missing destination file operand after 'app/.*backup'
Try 'cp --help' for more information.

If I get it I'm missing the destination file. Do I need to create a file? Or create a target directory for this?

Code:
@debian-box:~$ cp --help
Usage: cp [OPTION]... [-T] SOURCE DEST
  or:  cp [OPTION]... SOURCE... DIRECTORY
  or:  cp [OPTION]... -t DIRECTORY SOURCE...
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.

Reading here too to try to understand.

cp copies files (or, optionally, directories). The copy is completely independent of the original. You can either copy one file to another, or copy arbitrarily many files to a destination directory. Synopses:

cp [option]… [-T] source dest
cp [option]… source… directory
cp [option]… -t directory source…
  • If two file names are given, cp copies the first file to the second.
  • If the --target-directory (-t) option is given, or failing that if the last file is a directory and the --no-target-directory (-T) option is not given, cp copies each source file to the specified directory, using the sources’ names.

Suggestions please.
 


It appears that in this code:
Code:
@debian-box:~$ cp app/.*backup
the space before the destination (backup) is missing, hence, the message to that effect. The directory "backup" should exist for the command to work.
 
It appears that in this code:
Code:
@debian-box:~$ cp app/.*backup
the space before the destination (backup) is missing, hence, the message to that effect. The directory "backup" should exist for the command to work.

Would making a directory called Gimp_backup work?

Like so?
Code:
cp app/.*Gimp_backup
 
You can create the directory Gimp_backup, but the space before it in the command is still necessary to let cp know what the destination directory is named:
Code:
cp app/.* Gimp_backup
 
You can create the directory Gimp_backup, but the space before it in the command is still necessary to let cp know what the destination directory is named:
Code:
cp app/.* Gimp_backup
Thanks for showing me I didn't understand:-
I'll have to tend to this tomorrow gotta go to work soon.
:)
 
In the process of figuring out how to back up just the sessionrc file in GIMP.

Code:
debian-box:~/.config/GIMP/2.10$ ls
action-history  controllerrc  filters        menurc      sessionrc   tool-options
backups         CrashLog      fonts          parasiterc  tags.xml    toolrc
colorrc         devicerc      gimprc         pluginrc    templaterc  unitrc
contextrc       dockrc        internal-data  profilerc   themerc
 
It's a regular file.

In terminal:
cp ~/.config/GIMP/2.10/sessionrc /path/to/different/directory/*

In file manager, open ~/.config/GIMP/2.10 folder in one tab, and the directory you wish to back the file into, in a second tab. Then drag and drop. If both directories are on the same disk then be sure to hold CTRL key or the sessionrc will be moved to the other place...

EDIT: Be sure in your file manager that you could see hidden files. Press CTRL+H in Caja, PCManFM, Thunar or some other. Stay in your home directory and press that key combination until you could see .config and .local directories, and also .bashrc and those other ones. In a different file manager the keypress is CTRL+K but likely those are for the "squiggle backup" text files.

One more way is to just open sessionrc in a text editor, choose "File/Save As" and then choose the different location where you wish to back it up. This is if you don't care what is the original date of the file.
 
n the process of figuring out how to back up just the sessionrc file in GIMP.

See @wizardfromoz's post in your other thread:


Specifically:

"It's in ~/.config/ , so any method you currently use to backup or snapshot your Home will cover it."

If you're preserving /home/<user> in any way, it's almost certainly backing up any hidden files - but this isn't a dot file so will be backed up regardless.

You are preserving /home/<user> in a backup somewhere, right?
 
It's a regular file.

In terminal:
cp ~/.config/GIMP/2.10/sessionrc /path/to/different/directory/*

In file manager, open ~/.config/GIMP/2.10 folder in one tab, and the directory you wish to back the file into, in a second tab. Then drag and drop. If both directories are on the same disk then be sure to hold CTRL key or the sessionrc will be moved to the other place...

EDIT: Be sure in your file manager that you could see hidden files. Press CTRL+H in Caja, PCManFM, Thunar or some other. Stay in your home directory and press that key combination until you could see .config and .local directories, and also .bashrc and those other ones. In a different file manager the keypress is CTRL+K but likely those are for the "squiggle backup" text files.

One more way is to just open sessionrc in a text editor, choose "File/Save As" and then choose the different location where you wish to back it up. This is if you don't care what is the original date of the file.
Very clear and helpful, thank you wendy.
 
See @wizardfromoz's post in your other thread:


Specifically:

"It's in ~/.config/ , so any method you currently use to backup or snapshot your Home will cover it."

If you're preserving /home/<user> in any way, it's almost certainly backing up any hidden files - but this isn't a dot file so will be backed up regardless.

You are preserving /home/<user> in a backup somewhere, right?
Yes, backup's are on the 500 GB external Toshibia.
 
...- but this isn't a dot file so will be backed up regardless.

No, but it is under a dot folder .config so it will still be treated as hidden.

Wiz
 
Back up created. Named sesionrcbkup.odt.

Code:
debian-box:~/Documents$ ls
 Acrylics.xcf                    'Leaf On Rock.xcf'
'Autum Leaves.xcf'                leaves_frost_fallen_138071_1920x1080.xcf
 Autum.xcf                        Maple.xcf
'Blue Mountains.xcf'             'Orange Fall.xcf'
 bookmarks.html                  'Red Leaf Two.xcf'
'Card 2.xcf'                     'Red Leaf.xcf'
'Card for Pat.xcf'                sessionrc
'Dark Fall.xcf'                   sessionrcbkup.odt
 
One question, isn't .odt a filename protocol for Libreoffice?
 
No, but it is under a dot folder .config so it will still be treated as hidden.

Wiz

While a valid point, any reasonable backup process/application will grab dot directories (and files).

As an aside, I often just manually preserve my home directory. It's a 30 second copy and paste to a shared network drive. Well, the process takes longer but my activities are very minimal. I just copy and paste, wait to pick merge and skip any files that it won't backup automatically. Those files have never been consequential. I think they're things like some browser cache files. So, I guess it might take me a minute.

I should run fiber to make it even faster.
 

I hope Alexzee remembers to export that ODT-suffix file into a plain text file to use it again with GIMP.

I think I should have been more clear. Open the text file into an editor like GEdit, Pluma, Geany, L3afpad or other that only saves text files. Opening in Libreoffice Writer, then trying to save it elsewhere usually assumes to save as Open Document Text, unless something was done about it in the preferences. This is alike with a different office suite or independent word processor which has a weird document text-like format. :)
 

I hope Alexzee remembers to export that ODT-suffix file into a plain text file to use it again with GIMP.

I think I should have been more clear. Open the text file into an editor like GEdit, Pluma, Geany, L3afpad or other that only saves text files. Opening in Libreoffice Writer, then trying to save it elsewhere usually assumes to save as Open Document Text, unless something was done about it in the preferences. This is alike with a different office suite or independent word processor which has a weird document text-like format. :)
I didn't export the odt into a plain text. Didn't know that was a usual practice.

Installed Gedit on my LMDE6 install as I wasn't booted into Debian 12.
Figured it's one way to learn.
I discovered that the sessionrc did not exist under the .config/GIMP/2.10/.
It's late and I'll have more time to boot into my Debian 12 installation in the afternoon tomorrow.
 
I tried to tell you, because now you're saying sessionrc is not in the GIMP configuration directory of your Debian "Bookworm".

If somebody else only knew to save to ODT, he/she would have a serious problem. Because GIMP wouldn't recognize sessionrc.odt even if it's in the right place. In that case, when he/she starts GIMP, it would just create a new text file called sessionrc which might produce a "WTF?" That's why I tried to clarify that an easy way to transfer a text file from one partition to another was to open it in a text editor usually used for programming.

If somebody else knew to save to Abiword's document format, he/she wouldn't care that the main difference between that format and a text file is that document format is mostly XML. This was from 2010 or so the last time I used that program because it was buggy. GIMP for this sessionrc only cares about a fake LISP/Scheme program, not XML. Which could be frustrating to a beginner who could say, "But it's a text file, what's the difference?"

I'm sorry if it looks like I'm building a scandal about something small. But this is to warn that using a word processor or other text-handling program, to save in its native format, might not do what is expected toward a program that does a totally different thing but expects configuration to be in plain text format.
 
The plan was to fixed this however; I was hindered by one of those ocular migraines. Painfully blinding mates!

Sessionrc does not exist in the config directory of Gimp on my LMDE6 install.
I made that clear in post #17.

Sessionrc does exist in the Gimp config directory on my Debian 12 installation.

Sitting back debating on creating a file with the touch command, manually backing up like KGIII shared. < Or > use vim or nano to create a back-up. Installing Gedit is also an option.

The beauty of it all on this is: with Linux I have more than one way to rectify this:-:)
 

Attachments

  • [Sessionrc] (imported)-1.0 (RGB color 8-bit gamma integer, GIMP built-in sRGB, 1 layer) 1920x1...png
    [Sessionrc] (imported)-1.0 (RGB color 8-bit gamma integer, GIMP built-in sRGB, 1 layer) 1920x1...png
    256.6 KB · Views: 41
Sitting back debating on creating a file with the touch command, manually backing up like KGIII shared. < Or > use vim or nano to create a back-up. Installing Gedit is also an option.

Open your file manager. Press the UP button, so that you're in the /home directory instead of the /home/<user> directory.

Right click on it and select 'Copy'.

Open a new tab with your file manager. Navigate to your external drive or backup drive.

Right click in a blank area and select "Paste'.

Tada! You've backed up your home directory.

Repeat this regularly. Only, wait and watch the copy process start. You'll be prompted to overwrite existing files/merge. Any file that refuses to copy can be safely skipped.

There... You have a working backup system for your important files. If your install breaks, or if you install on another device, just do a clean install and copy back /home/<user> to the right directory. Then, install any missing software - and that software should use the configuration files that you backed up.

I can restore even Google Chrome this way and when I open Chrome up I see all my tabs open, all my passwords saved, all my favorites, all my settings, etc... I'm usually even still logged into the browser.

It's the easiest way to preserve /home that I can think of. It doesn't even take long ESPECIALLY if you store important data on a disk other than your OS disk.
 

Members online


Latest posts

Top