You are not logged in.
Hi there,
i have several questions
1.
if i want to move the whole backup content from /actualbackup folder to /oldandstable folder
have i to use
mv /run/media/myusername/ArchBackup/actualbackup/* /run/media/myusername/ArchBackup/oldandstable
?
2.
if i want to do a backup on external drive and overwrite existing data, i do
sudo rsync -aAXHv --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /run/media/myusername/ArchBackup/actualbackup
is that about right?
Thanks for reading and hopefuly even replying to my thread!
Last edited by ArchNewbieKernel (2020-11-25 09:22:17)
Offline
Mooks reasonable. Two things I noticed: /media is not in a standard Arch Linux file system, and you are not backing it up.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
The "mv" will not cover hidden files.
For regular backups you might want to use a hardlink copy (cp -al) of the last backup and "rsyc … --delete …" for space conserving full backup versions.
Then use the date as path denominator.
Offline
Mooks reasonable. I noticed: /media is not in a standard Arch Linux file system
thats correct, i use Dolphin file Manager and it worked the last time i made the first backup to the external drive.
Offline
The "mv" will not cover hidden files.
For regular backups you might want to use a hardlink copy (cp -al) of the last backup and "rsyc … --delete …" for space conserving full backup versions.
Then use the date as path denominator.
would it be something like this
cp -al /run/media/myusername/ArchBackup/actualbackup/* /run/media/myusername/ArchBackup/oldandstable
then
sudo rsync -aAXHv --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / /run/media/myusername/ArchBackup/actualbackup
?
Offline
What does "/run/media/myusername/ArchBackup/oldandstable" look like before?
You want that to be an empty directory.
What you could do is sth. like
bkpdir=/run/media/myusername/ArchBackup/$(date +%F.%R) # date based backup path
cp -ai $(realpath /run/media/myusername/ArchBackup/latest) $bkpdir # hardlink the last backup there
sudo rsync -aAXHv --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / $bkpdir # update the backup
ln -sf $bkpdir /run/media/myusername/ArchBackup/latest # symlink the new bakup as "latest"
I've written this down as is w/o any testing, there could even be typos in it, so use it as inspiration and test it. Not a blind copy-and-whoopsadaisy.
Offline
Please edit your topic title to actually describe what you are trying to accomplish.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
What does "/run/media/myusername/ArchBackup/oldandstable" look like before?
Its the most actual backup in it. I guess i gonna shred /oldandstable.
You want that to be an empty directory.
why?
What you could do is sth. like
# date based backup path
bkpdir=/run/media/myusername/ArchBackup/$(date +%F.%R)
# hardlink the last backup there
cp -ai $(realpath /run/media/myusername/ArchBackup/latest) $bkpdir
# update the backup
sudo rsync -aAXHv --delete --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} / $bkpdir
# symlink the new bakup as "latest"
ln -sf $bkpdir /run/media/myusername/ArchBackup/latest
the codes with explainations in # looks lovely.
whoopsadaisy.
this got me laughin'! Definitely like your humor and i mean it in a good way!
gonna try your written solution in a VM tomorrow!
Last edited by ArchNewbieKernel (2020-11-21 19:51:18)
Offline
why?
mkdir -p foo/bar bar/bar
touch foo/bar/foo bar/bar/foo
mv foo/* bar/
Also you'd end up with a wild mix of "backup" iterations (more like a random heap of old data)
Offline
why?
mkdir -p foo/bar bar/bar touch foo/bar/foo bar/bar/foo mv foo/* bar/
Also you'd end up with a wild mix of "backup" iterations (more like a random heap of old data)
thanks, it seems to work!
I just noticed, that in Latest symlink with 2020-11-23.09.58 inside of home folder it has a sdc folder (which is a disk) beside myusername. Is that normal? When i try to open 2020-11-23.09.58/home/sdc/home/myusername which has a lock symbol on it, i get error saying
"could not enter folder /run/media/myusernamer/ArchBackup/2020-11-23.09.58/home/sdc/home/myusername."
while
2020-11-23.09.58/home/myusername
can be opened.
Offline
Well, is there a "/home/sdc"?
Can you see in the rsync output where the directory came from?
It would seem it's a second (bound) mount of the root directory?
What's
stat /run/media/myusernamer/ArchBackup/2020-11-23.09.58/home/sdc/home/myusername
stat /run/media/myusernamer/ArchBackup/2020-11-23.09.58/home/myusername
Offline
Well, is there a "/home/sdc"?
yes, right after the "/2020-11-23.09.58"
Can you see in the rsync output where the directory came from?
tried "cat ~/.bash_history" but couldnt find the output anymore ( maybe i looked wrong)
It would seem it's a second (bound) mount of the root directory?
What'sstat /run/media/myusernamer/ArchBackup/2020-11-23.09.58/home/sdc/home/myusername stat /run/media/myusernamer/ArchBackup/2020-11-23.09.58/home/myusername
input with output:
$ stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc/home /myusername
File: /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc/home/myusername
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fe00h/65024d Inode: 28709811 Links: 19
Access: (0700/drwx------) Uid: ( 0/ root) Gid: ( 1000/myusername)
Access: 2020-11-23 10:01:33.493652915 +0000
Modify: 2020-09-20 17:58:24.678572445 +0000
Change: 2020-11-23 10:01:33.626986251 +0000
Birth: 2020-11-23 10:01:33.493652915 +0000
$ stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home /myusername
File: /run/media/myusername/ArchBackup/2020-11-23.09:58/home/myusername
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fe00h/65024d Inode: 27526850 Links: 20
Access: (0700/drwx------) Uid: ( 1000/myusername) Gid: ( 1000/myusername)
Access: 2020-11-23 10:31:55.037024707 +0000
Modify: 2020-11-23 09:12:40.483589653 +0000
Change: 2020-11-23 10:13:47.217001702 +0000
Birth: 2020-11-23 09:58:32.426982422 +0000
Offline
yes, right after the "/2020-11-23.09.58"
No… in the absolute path - the one you're backing up…
tried "cat ~/.bash_history"
No again: the rsync output. Not your bashrc.
The directory the inside the "sdc" belogns to the root user, so you sudo'd it there and it should™ not have been the rsync call (because "-a")
stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc/home
stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc
stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home
stat /home/sdc
Offline
The directory the inside the "sdc" belogns to the root user, so you sudo'd it there and it should™ not have been the rsync call (because "-a")
stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc/home stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home stat /home/sdc
I'm sorry but this time i don't get what you mean. You want me to sudo execute something and then run the 4 "stat" commands ?
Offline
Just run the 4 stats and post the output.
---
The other part is an explanation that you must have created "/run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc/home/myusername" using some sudo command - and that this sudo command cannot have been "rsync -…a…" (because that preserves ownership)
Offline
an explanation that you must have created "/run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc/home/myusername" using some sudo command - and that this sudo command cannot have been "rsync -…a…" (because that preserves ownership)
ah! thats right because UID=1000 is main user/root.
Just run the 4 stats and post the output.
$ stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc/home
File: /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc/home
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fe00h/65024d Inode: 27526862 Links: 3
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 1000/myusername)
Access: 2020-11-23 10:55:05.680387907 +0000
Modify: 2020-09-08 06:23:03.384053293 +0000
Change: 2020-11-23 10:01:33.626986251 +0000
Birth: 2020-11-23 09:58:32.426982422 +0000
$ stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc
File: /run/media/myusername/ArchBackup/2020-11-23.09:58/home/sdc
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fe00h/65024d Inode: 27526849 Links: 19
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 1000/myusername)
Access: 2020-11-23 10:31:55.030358041 +0000
Modify: 2020-09-26 07:40:47.874561119 +0000
Change: 2020-11-23 09:58:32.643649093 +0000
Birth: 2020-11-23 09:58:32.426982422 +0000
$ stat /run/media/myusername/ArchBackup/2020-11-23.09:58/home
File: /run/media/myusername/ArchBackup/2020-11-23.09:58/home
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: fe00h/65024d Inode: 27525130 Links: 4
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 1000/myusername)
Access: 2020-11-23 10:01:12.390319136 +0000
Modify: 2020-09-08 06:23:03.384053293 +0000
Change: 2020-11-23 09:58:32.643649093 +0000
Birth: 2020-11-23 09:58:31.606982405 +0000
$ stat /home/sdc
File: /home/sdc
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 803h/2051d Inode: 45754647 Links: 19
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 1000/myusername)
Access: 2020-11-23 09:58:32.413649089 +0000
Modify: 2020-09-26 07:40:47.874561119 +0000
Change: 2020-09-29 18:51:11.687665946 +0000
Birth: 2020-09-26 12:31:11.182639548 +0000
Offline
$ stat /home/sdc
File: /home/sdc
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 803h/2051d Inode: 45754647 Links: 19
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 1000/myusername)
Access: 2020-11-23 09:58:32.413649089 +0000
Modify: 2020-09-26 07:40:47.874561119 +0000
Change: 2020-09-29 18:51:11.687665946 +0000
Birth: 2020-09-26 12:31:11.182639548 +0000
So the directory is simply there - you created it 2020-09-26 12:31:11 (and it obviously gets archived)
What or why it is, I've no idea. Look at it, but I suspect it's some botched previous backup attempt?
Offline
$ stat /home/sdc File: /home/sdc Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 803h/2051d Inode: 45754647 Links: 19 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 1000/myusername) Access: 2020-11-23 09:58:32.413649089 +0000 Modify: 2020-09-26 07:40:47.874561119 +0000 Change: 2020-09-29 18:51:11.687665946 +0000 Birth: 2020-09-26 12:31:11.182639548 +0000
So the directory is simply there - you created it 2020-09-26 12:31:11 (and it obviously gets archived)
What or why it is, I've no idea. Look at it, but I suspect it's some botched previous backup attempt?
I assume this happened when i chroooted into the System back then and used the wrong directory to place the backup.
Do you think its safe to shred "/sdc" folder ?
Must be an old backup attemp, since you underlined the fact that the user inside of it is locked because i havent ran it in sudo.
Offline
I think you need to look into the directory and its subdirectories to see whether you've important data there.
I'm not going to make a statement about deleting a path that I know nothing about.
Offline
I think you need to look into the directory and its subdirectories to see whether you've important data there.
I'm not going to make a statement about deleting a path that I know nothing about.
worked!
Thank you so much for your time and patience in this topic!
Offline
I would have used Timeshift. Simple and easy to set up then set up a cron with
0 0 * * 1,3,5 timeshift --create --comments "cron time"
Works great.
Hey, but that's me. Different strokes for different folks.
If you don't like cron you could set up a systemd timer instead.
Last edited by herbie643 (2020-11-25 16:45:28)
Offline