I use csh. [*,.*] is supposed to glob all files and directories and all dot files and dot directories
I had better check bash… dont want to mislead anyone
You want to exclude exactly (and only) “.” and “..”.
I mean: “...” or “..a” are perfectly valid. The best bet is globskipdots, IMHO. As anyway you are using a bash syntax now, this would be fine (this option is the default for some distribs, at least on all I have: Debian, Ubuntu, and MX)…
Edit: if I understand what you try to do, what about “./”, instead of trying to list all files and directories in current directory ? Or did I miss something ?
Note: I replaced “./” with “.”, which is the normal way to do, but there will be exactly no difference (even for rsync exception discussed previously, as the missing trailing ‘/’ in source will not create “.” at dst, for obvious reasons). I used “./” previously for pure cosmetic reasons.
My own backup script always (1) cd to source dir, and (2) perform the rsync on “.”.
OK, that is the best solution, because it does not depend on any bashisms
I will add a further note to my original reply, with due acknowledgement of course.
I dont want people seeing that and getting half the message
Thank you.
PS Your script is too complicated for me. I want a one line command that I understand.
It looks like complicated, only because it is a incremental backup script, not a copy one
I did not want from beginning to use a backup software, as, would it disappear/be unavailable, I would not be able to find easily my data (where is my 5 days or 2 weeks or 6 months or 1 year data without the backup software ?).
This is a personal preference only: I like to get this data with a simple “cd” Even if I disappear, all is easily available, by date (without any software).
I agree. cp is unlikely to disappear.
I originally used tar without unpacking the destination
I tried borg for a while… it frightened me.
I reverted to rsync, but cp is probably the simplest… provided it deals with ACL’s…
we still have to resolve that.
Here is a test… if you wanted to copy a whole OS to another partition… would you use cp?.. would the new copy work?.. I know rsync -aAXvH works.
Frankly speaking, these scripts started with one line command (similar to the “rsync” discussed here), that I had to type again and again, until I had that command in a script (sync.sh).
That script simply evolved (very slowly) later:
I just improved it to allow some parameters/config to specify files to exclude and destination, and to keep previous backup versions (day/week/…) without losing disk space. Nothing more. The rest is mostly cosmetic.
If you type a rsync backup command from time to time, I am 100% sure it will become a one line script soon… If yes, I guess you will add one first option in a not so far future… Voilà
You are right, things evolve.
At the moment I have a file with a collection of rsync commands that I copy/past… at least it avoids typos.
I will be adding some tar and cp recipes.
This has been interesting and educational. Thanks
I have to get back to timing clonezilla… yes I use that, I dont depend entirely on rsync copies.
Will clonezilla allow you to access your history without clonezilla itself ?
If yes, go for it, I will happily follow, please let me know. The backups above will survive me, and my family will have easy access (no software needed).
I know I can go into a Clonezilla image directory and look at the files. Each partition can have multiple image files if it is large. I will have to investigate … by default clonezilla uses the partclone utility and zip compression.
Clonezilla is not meant for archiving. It does not do incrementals. It is meant for full recovery when your disk fails.
And if you don’t have clonezilla, can you recover ? My point was to access backups without any software (ls and cp will be enough). Again, I will love to use clonezilla, if I can get data back without clonezilla.