Since I've moved to Artix and learning about where the packages are stored, I decided to make them a part of my files to be backed up.
I have experienced a problem while backing up the files.
# cp -r /var/cache/pacman/pkg /run/media/tsedek1/unique-dev-id/Downloads/
These are the errors I get for some of the files:
cp: cannot create regular file '/run/media/tsedek1/unique-dev-id/Downloads/arch/pkg/nftables-1:1.1.1-2-x86_64.pkg.tar.zst.sig': Invalid argument
cp: cannot create regular file '/run/media/tsedek1/unique-dev-id/Downloads/arch/pkg/iptables-1:1.8.11-2-x86_64.pkg.tar.zst': Invalid argument
cp: cannot create regular file '/run/media/tsedek1/unique-dev-id/Downloads/arch/pkg/iptables-1:1.8.11-2-x86_64.pkg.tar.zst.sig': Invalid argument
cp: cannot create regular file '/run/media/tsedek1/unique-dev-id/Downloads/arch/pkg/libadwaita-1:1.7.0-2-x86_64.pkg.tar.zst': Invalid argument
cp: cannot create regular file '/run/media/tsedek1/unique-dev-id/Downloads/arch/pkg/libadwaita-1:1.7.0-2-x86_64.pkg.tar.zst.sig': Invalid argument
cp: cannot create regular file '/run/media/tsedek1/unique-dev-id/Downloads/arch/pkg/libgovirt-2:0.3.9-2-x86_64.pkg.tar.zst': Invalid argument
Sometimes it copies the files changing the : into _, but not always. Currently, cp doesn't copy the : files at all.
Apparently, colons are a command argument.
How can I backup these files without the 'Invalid argument'?
Tried this variation with no luck:
# cp -a /var/cache/pacman/pkg /run/media/tsedek1/unique-dev-id/Downloads/arch/
cp: failed to preserve ownership for '/run/media/tsedek1/unique-dev-id/Downloads/arch/pkg/gcc-14.2.1+r753+g1cd744a6828f-1-x86_64.pkg.tar.zst': Operation not permitted
The error probably means the filenames are illegal for the target filesystem.
You could create a different filesystem on the backup drive.
Or, you could tar the entire cache directory and give the tarball a simpler name.
I didn't know FAT was an illegal file system.
Tried this as a solution:
-t, --target-directory=DIRECTORY
copy all SOURCE arguments into DIRECTORY
Did not work. It copied all of the files except for file names with colons.
Additionally, it left the target directory open, not closing the folder and provided no errors.
Tried this one because it appears to preserve file names:
--parents
use full source file name under DIRECTORY
Unfortunately this copies parent directories from the current directory.
So when, 'cp /var/cache/pacman/pkg' it will copy everything up to and including '/var'
Looks like it's baked in:
// We use `:` as a delimiter between CONTAINER and PATH, but `:` could also be
// in a valid LOCALPATH, like `file:name.txt`. We can resolve this ambiguity by
// requiring a LOCALPATH with a `:` to be made explicit with a relative or
// absolute path:
// `/path/to/file:name.txt` or `./file:name.txt`
//
// This is apparently how `scp` handles this as well:
// http://www.cyberciti.biz/faq/rsync-scp-file-name-with-colon-punctuation-in-it/
//
// We can't simply check for a filepath separator because container names may
// have a separator, e.g., "host0/cname1" if container is in a Docker cluster,
// so we have to check for a `/` or `.` prefix. Also, in the case of a Windows
// client, a `:` could be part of an absolute Windows path, in which case it
// is immediately proceeded by a backslash
According to: https://github.com/docker/cli/issues/1125
Why are you asking questions here if you refuse to read and accept the answers? You make it sound like this is something complicated about using the cp command correctly. It's not.
FAT is an ancient file system that does not support very long or complex filenames. That is your only problem here. Apart from renaming the individual files, you have the two options I offered for how to easily resolve this.
Is there a reason you need this backup to be readable on a Windows machine or something?
$ tar -cvf /tmp/pkgcache.tar /var/cache/pacman/pkg/ && cp /tmp/pkgcache.tar /path/to/Microsoftformattedbackupdrive && rm /tmp/pkgcache.tar
The tar ball achive will preserve the original file names but allow the whole thing to be copied across, also it can sometimes be faster to copy a single large file than many small ones. The packages are already compressed so you don't need to add a compression flag.
NTFS has the same illegal characters, it's a Windows thing, built in to the destination file system. You could also reformat the backup drive to a Linux filesystem like ext4 or btrfs. And there are some methods to rename files, there are numerous suggestions how to do this online like here:
https://superuser.com/questions/178025/linux-copy-to-fat32-filesystem-invalid-argument (https://superuser.com/questions/178025/linux-copy-to-fat32-filesystem-invalid-argument)
Although I would imagine for the purpose of a backup it would probably be better to use tar as suggested by lotuskip and not change the names.
You should be able to find old packages in the Artix package archives so depending on what you have in mind, you may not need to save them locally either.
CP is not working as I would expect. Anything with file name should not be ignored because it can't be anything other than a filename.
Also:
There is no consensus on why it doesn't work. Some suggest Windows file names, while others point to File Systems.
But, looking at the Docker explanation, it appears the colon is baked into cp to help Docker with their structure.
I'm not into Eugenics. Windows is built by a death cult. I don't support anyone who uses Windows.
On a less assaultive note.. tar -cf pkg seems to work well enough. A few extra steps, but it works.
I have found I like backing up the pkg files. It gives me the ability to install offline. Currently I'm learning how to install packages with dependencies.
~# pacman -U /var/cache/pacman/pkg/nushell-0.103.0-1-x86_64.pkg.tar.zst
It saves from having to download a gig or more of files. When I already have them pacman installs what is present and only downloads what it needs, like files not in the pkg directory or new versions.
Security wise it's a benefit, being able to do most installs without an internet, where the attackers live.
It's a Linux all the way around.
I install Auditd and nftables, configure them, before ever connecting.
Your brain is not working as I would expect.
You've been told. You can't have colons in FAT filenames.
You were trying to copy files with colons in the filename to a FAT filesystem.
It won't work.
A file system is a data structure written to a blank drive, which provides something like a contents page or index in a book, to access the data throughout. The file names are recorded in this index. Microsoft Windows has different rules to Linux regarding what characters can be used to name the files, so any Microsoft file system like FAT or NTFS has to obey these rules, even if it is being accessed from Linux, because Linux is only interfacing with what is already on the drive. Besides the character restrictions in the file names, MS file systems also don't support Linux file permissions, so that information will be lost too unless you wrap files in a tar archive first.
it wouldn't be a bad idea to learn about tar and rsync
~$ tar -cf pkg
...is working well. A few extra steps, but it's working.
nushell has columns...But, 'Detect Columns' doesn't work on the audit.log files.
pacman -U /var/cache/pacman/pkg/nushell-0.103.0-1-x86_64.pkg.tar.zst
;D
I don't think I'm interested in 'rsync' at this time. I'm trying to prevent shenanigans.sh from being installed, so am weary of network related apps ATM.
After I learn to lock this thing down, like limit remote root, I'll revisit other apps.
Artix-OpenRC with it's 3 minute installation is amazing.
It feels like I've been using dban with 13 hours for 3 passes, only to discover the 'secure erase command' and shred it all in 80 minutes.
8)
[quote ]
I don't think I'm interested in 'rsync' at this time.
[/quote]
that is a failure on your part and it reinforces the reluctance people have to help you. The rest of what you wrote is static.
BTW - grip is right. If you want to back up those file, and I don't know why you would do so, you can't copy them on to a VFAT file system so you need to learn something as simple as the mkfs.ext4 command and join the rest of us into the late 20th century. Although your best solution might be to make a tarball which will contain all the file permission and ownership information.
When it is not in peoples hearts to be helpful, who can fix that?
- Wikipedia
It is another tool with it's list of 'This is how you use this tool' Learning strategy.
Man pages as pseudo technical documents have as their target audience Not Beginners. Man pages are written from the perspective that you already have a basis in linux at an advanced level. Their target audience is PH.d users, not intended for the general population. This is intentional, as Brian Kernighan has explained. Telling a beginner to read the Man pages will only create confusion.
A more immediate problem that had been consuming my time, Mama Mia:
These retards that keep infiltrating and causing me problems hasn't left me a lot of time for learning new things. I have been way too busy putting out fires to be concerned with learning new tools. My learning has been focused on closing the holes in my non-existing security structure. I'm not a CS Engineer and I have to deal with these homogenius's trying to protect their Israel Brotherhood of Diaper Diddlers Union servicing the Tourism Industry and who don't like Scabs being vocal about their Union activities.
Reviewing logs has been the biggest help in identifying what they're doing. Answering 'what happened?' is the first step. When you understand 'What?' then you can begin to ask other questions.
Select/Copy/Paste or highlight all then drag and drop form one window to another has been how I manage, and I haven't had much freedom or time to breath. Infected, Re-installation, Infected, Re-installation....All while trying to find a solution that restores my freedom.
On the Team Linux innitiative, 'Got Root?'
Nope, It's not just a question, it's the solution.
[Solved] :D
Now I can breath and write nice tutorials and return to my Biblical Research
I know Sedek is typically an Egyptian or Islamic name, but please don't troll Mr Brklyn for things he has no control over, he works in medicine and does spend his time helping people. If you think about it, most of us have no real say in what our governments do, nor do we agree with all of it. While there might be some undesirable things going on, it doesn't mean the Artix forum needs to follow suit. Changing the world is difficult, but we can at least make the part we are in a nice friendly place.
I am glad I missed this...
FWIW - I thought Tzedek was a Yiddish bastardization of Tzadek... although I didn't give it much thought because ... it could just be something lifted out of a fictional book or the Hobbit or something as far as I knew.
On NYLUG with had Ah Pook... In researching that handle it ended up being an interesting reference to William S Burroughs - a great Beatnik poet
https://www.youtube.com/watch?v=Gen7_djK7eg
In old days they rally new how to be communists and anarchists in the Village.
Well I don't actually know what the intent was or if it was aimed at anyone but there was also a slightly suspect prompt in a code box here:
https://forum.artixlinux.org/index.php/topic,8065.msg48276.html#msg48276
And I'm sure we can do without setting noob off again... ;)
I see this topic as answered and find no need for it to get derailed more.