Search code examples
linuxbashubuntusshbackup

Backup latest ubuntu server


I need to copy a drive from remote host. I can't do it just with scp, maybe there are some workarounds and solutions for this? Operating system is ubuntu 20.04 If you need more information, please ask me for more information. I have searched on Google but doesn't work... I am very thanks for you.


Solution

  • To copy a full filesystem from a remote host, you can use the command:

    ssh user@hostname 'sudo tar -cJf - --acls --selinux --one-file-system /' > full_dump.tar.xz
    

    Then just unzip tar.xz into the current directory. To do this, use something like this:

    tar xf linux_full_dump.tar.xz