1

Summary:
I need to backup a folder (not the entire system) with 450 GB worth of content to many different external drives (NTFS and ext4). I'd like to archive it (tar) and compress it (maybe gzip?) before backing up. After that, I (and any other user with this folder) need to be able to download the archive from one of the drives, decompress it, and start editing, creating, deleting, and moving things without any type of problem related to permissions or mismatched file systems.

This whole process (downloading from drive->decompressing->editing content without problems related to permissions and/or file systems) has to be doable on Ubuntu and on Windows 10, despite the fact that the archive originated from a Linux distro (Ubuntu 20) with an Ext4 file system -- preserving the initial directory structure is very important.

Will the command bellow accomplish this (p flag omitted on purpose)?

~$ tar -czvf folder_backup.tar.gz --exclude=/folder_backup.tar.gz /path/to/important/folder

After reading a lot of other questions (cited below), I get the feeling that this will indeed work the way I explained above, but only on ext4 to ext4 (external drive with ext4 to OS with ext4). If that's the case and there's no "cross-platform" solution, I'd be okay with creating two backups (one for ext4 drives/OSes and one for NTFS drives/OSes), but this has to doable from Ubuntu. Meaning, creating both types of archives from Ubuntu (how would I do that?)

Any help is appreciated. I think my machine's internal drive is at the end of its life, so backing up this folder is super important to me. Thank you!!

Note: I cannot format the drives with NTFS and convert them to ext4; archiving as FAT in 2-4 GB chunks isn't practical and I'd rather create two separate backups; I'm open to creating two different archives, but only as a last resort.



More details

This folder is not confidential at all (there isn't any sensitive information like credit card number or passwords) and I might even share it with some family members, so I do not want to preserve permissions/ownership.

I found similar questions to this on AskUbuntu and Unix&Linux StackExc. However, most questions I found (most are not cited below) are about preserving permissions/ownership which isn't my goal.


Backup Files on ext4 to external NTFS drive (Unix&Linux StackExc.)

  1. "You will maybe lose the permissions... If this is important for you (which I doubt), you have to create a tar-file first and then transfer it to the NTFS-drive."

  2. "One downside of tar would be the loss of POSIX ACLs, but those are not very common, so there I would say they are probably not important."

==> My folder does not have POSIX ACLs.

  1. "Permissions all by themselves are a shark that will sooner or later swim up and bite you in the ass, though not fatally."
  2. "... mismatched permission (such as those lost moving from unix/Linux 1777 style bits) are what will hurt you, precisely because such permissions are essential."

Can I use an NTFS external hard drive to backup my linux server which is Ext4? (Unix&Linux StackExc.)

  1. "For disk images - certainly. On a file basis - again, like you said, NTFS has a lot more limitations in terms of allowed characters."

Copying files between Ubuntu and WIndows partitions (AskUbuntu)

  1. "No, you wouldn't face any problems because of transferring files between Ubuntu and Windows partitions (via Nautilus)."
  2. "For those using a desktop version of Ubuntu, ..., the easiest and quickest way of mounting NTFS or FAT32 partitions is from the file manager: Nautilus in Ubuntu, ... Simply look in the left pane of the file manager for the partition you wish to mount and click on it - it will be mounted and its contents will show up in the main pane."

However, these questions, although similar, do not address my concerns, and that's why I'm posting this question.

This is how Ubuntu Docs recommends:

~$ tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --one-file-system /

I don't need the --one-file-system / bit since I only have one file system (one HDD) on my Ubuntu machine. And I removed the p flag (for permissions) since this archive has to be accessible from different machines, and all of them have to be able to read, write, edit, move, delete, etc.. (no matter the OS).

And this is how I thought about doing it (only this folder and its content, not the entire system):

~$ tar -czvf folder_backup.tar.gz --exclude=/folder_backup.tar.gz /path/to/important/folder

Should I use sudo for this?

--exclude=/backup.tar.gz -- "The first exclusion rule directs tar not to back itself up, this is important to avoid errors during the operation." Is this bit really necessary? If so, is the command above correct?

Thank you again!

2
  • "Any user" may not know how to decompress the tarball that you are creating.
    – user535733
    Oct 2, 2020 at 21:27
  • Yes, you're right. But in this case, this is not an issue :)
    – rpk24x1
    Oct 2, 2020 at 21:33

0

You must log in to answer this question.

Browse other questions tagged .