13
votes
Accepted
How to exclude swapfile from rsync backup?
The filter file is particular about its whitespace. For example, after the leading - (dash, space) everything is a relevant character. This includes trailing space.
You can check the filter file for ...
6
votes
Accepted
Equivalent of `btrfs send` and `btrfs recv` for bcachefs
The roadmap for bcachefs mentions it:
Send and receive:
Like ZFS and btrfs have, we need it to. This will give us the ability
to efficiently synchronize filesystems over a network for
backup/...
3
votes
How do you back up an entire Fedora Linux system at the file level?
I'd use .img instead of tar, with partclone.It's on the repository. Change ext4 to match your file system type.
partclone.ext4
Create a disk image:
partclone.ext4 -c -d -s /dev/sda1 -o ~/sda1.img
...
2
votes
Accepted
How to read and restore the last megabyte of a drive using Python
A block device, just like a regular file, has a size. You can query that, calculate the start of the last megabyte and seek there:
# assume you've already `open()`ed the file as f
# seek to end of ...
2
votes
Accepted
What is the best approach to backing up the /home directory to NTFS partition?
you can use getfacl and setfacl to backup/restore the permissions / ownership of files when copying between ntfs and other filesystems on linux:
to backup:
cp -rv /home /mnt/ntfs_vol
getfacl -R /home ...
2
votes
Accepted
The proper way to backup
Combining restic with rclone allows you to set up a service on a backup server using rclone that serves a restic REST API that restic can connect to from the machine(s) that you want to back up. ...
2
votes
Fix symbolic links in mass across filesystems. Absolute links pointing to original source, not new equivalent location
I would like to thank @larsks for his contribution.
Unfortunately, I will not be able to test it as I already processed the links thanks to this article. I will present the solution I found as well ...
1
vote
Accepted
Preserving file extensions when renaming duplicate files with rsync
You will probably have to handle this with a separate program to "fix" the filenames. Here's an example in bash
to start from:
#!/bin/bash
find TARGET-DIR -name '*~' -print0 |
while IFS= ...
1
vote
rsync: mkstemp failed: Invalid argument (22), stuck on a file, how to fix?
What is your source filesystem? I suspect the problem is the colon in the filename. It should technically be compatible with NTFS, but is probably disallowed to prevent problems when mounting on a ...
1
vote
Accepted
Can Ed be configured to automatically create backup files?
The ed editor does not provide a backup facility (or any way to configure it, at all). Writing the editing buffer back to disk with the w command overwrites the original file.
It is up to you to edit ...
1
vote
Restoring backed up Linux Partition
First off, mount /dev/sdb1 on /src. I know you don't have a /boot/efi in your image, but I don't know whether your /boot was separate. Check whether there's an entry for /boot in /src/etc/fstab. If ...
1
vote
Moving files to new drive - but preserve Symlinks (lots of them) from a backup application
Is there a away to tell rsync to copy the whole structure and maintain the symlinks within that structure rather than expanding them
Absolutely. You will also want to maintain any metadata that rsync ...
1
vote
Many of my text files are suddenly missing
I managed to find my files, they were moved into a unexpected location - I still do not know how.
The command used was
sudo su
find / -type f -name "peter.txt"
1
vote
Many of my text files are suddenly missing
If someone knew about these files, that could have been a bad actor as well.
The first thing to do when you've noticed that your files have disappeared is to shutdown your system immediately, if it's ...
1
vote
Ubuntu Server disk cloning + saving on another disk in network
What is the best way of creating a backup?
While this site doesn't recommend software, I'm adding the following link due to it being pretty much the de facto standard for Linux image cloning and ...
1
vote
Accepted
Moving from plain LUKS to LVM on LUKS
It should work.
The archlinux mkinitcpio hook is lvm2, not lvm. Add this hook first. No harm done if no LVM is present yet. One less thing to worry about later.
Backups from a running system can be ...
1
vote
The proper way to backup
Every singe guide I read on 'how to do automated backups' tells me to put a passwordless ssh-key on my pi. I don't want to do this, because anyone with access to my pc, would have access to my backups ...
1
vote
The proper way to backup
The idea is to have a passwordless key that's restricted to specific operations.
For example, with Restic (which apparently stores backups via SFTP) or with plain rsync, you could have the backup ...
1
vote
Accepted
Cannot find out which files were not copied with rsync
You're using -q (--quiet) to suppress messages from the destination part of the transfer process. Remove this flag
1
vote
Accepted
GNU tar how to preserve file immutable attribute set by "chattr +i" in Linux?
I think you've found a shortcoming in GNU tar. But it's not like you think!
The "i" is what is called a "attribute" in Linux file system lingo. Now, you're correctly saving and ...
1
vote
Copy from HDD to USB 3.0 is really slow with Thunar, cp, and rsync
Test the USB HDD directly with dd and the status=progress oflag=direct to see if it is something with the USB / drive. I.E. dd if=/dev/urandom bs=4M status=progress oflag=direct of=/dev/sdX (Note: ...
1
vote
Why does `du` report that my `rsync` backup is not the same size as the original?
Let's address each of your questions one by one for clarity:
1. Is rsync failing to backup all of the data under ~/.mozilla? Or am I just using du incorrectly?
Based on the information you've provided,...
1
vote
Accepted
mirror a directory tree by hard links for file contents and symlinks for directory structure
It's not so difficult to implement. On a GNU system (for ln -r and sha1sum -z) and with zsh:
mkdir -p mirror/{data,tree} &&
find original -type f -exec sha1sum -z {} + |
while IFS= read -...
1
vote
Accepted
Rsync doesn't handle time correctly on a mounted folder on MacOS
If your NAS allows ssh login you will generally get a significantly more efficient file transfer if you ignore the SMB share and have rsync talk to the NAS directly:
rsync -rtiv --info=progress2 --...
1
vote
How do I access all the files on a disk image?
I then decompressed image.gz and tried to mount it by double clicking it (i.e. via DiskImageMounter.app) to make sure all the contents are there.
What you have is a full-disk backup. You haven't, but ...
1
vote
Minimal SD Card image
Got here from google, and I just want to mention that the Rufus tool can do this, at least for Windows.
I just imaged a 64GB sdcard and the image file created was 3.56GB. Flashed it onto a 32GB sdcard ...
1
vote
How to extract a single file from a cpio archive?
If you want to consume the file right away in a pipe you can skip the -d and
add --to--stdout
here is an overkill example - checking the MD5SUM of an executable in an initramfs cpio
$ objdump -sj '....
1
vote
What's the difference between "parent" and "clone source" with "btrfs send"?
I just wrote a long answer that also discusses the -p and -c options, copy and paste of the relevant section:
There can only be one parent
The man page and (old) wiki FAQ are unfortunately rather ...
1
vote
How to determine size of tar archive without creating it?
to calculate the size of a tar without creating it, with the GNU implementation of tar, use:
tar --totals -cf /dev/null folder/
time tar --totals -cf /dev/null folder/ # fast!
1
vote
Does a file move operation over SAMBA preserve the inode number?
Be careful if the Samba share's Linux top directory has two or more mounted Linux filesystems somewhere underneath it in the directory hierarchy.
If you then move something from under one of those sub-...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
backup × 1414rsync × 306
linux × 211
tar × 110
restore × 80
filesystems × 77
debian × 74
ubuntu × 69
dd × 68
shell-script × 52
files × 48
btrfs × 46
bash × 45
ssh × 45
permissions × 44
snapshot × 42
duplicity × 40
partition × 36
cron × 35
centos × 31
mount × 28
hard-disk × 28
lvm × 26
scripting × 24
file-copy × 24