Can not rsync my server

Discussion in 'Installation/Configuration' started by pecka33, Jun 14, 2023.

  1. pecka33

    pecka33 Member

    Hello,

    i have a dedicated server and i bought external disk to backup my server. I would like to backup my files of dedicated server to external disk via rsync, but i can not do it.

    For example transeferd are only few files and folders and after that process is stuck. For example i get

    Code:
    ssh: connect to host xx.xx.wedos.net port 22: Network is unreachable rsync: connection unexpectedly closed (0 bytes received so far) [sender] rsync error: unexplained error (code 255) at io.c(228) [sender=3.2.3]
    
    I need to backup all, so thats mean /

    I tried to
    Code:
    sudo rsync -avz -e ssh / [email protected]:/
    
    but is stuck.

    They told me that for secure connection i need to use port 874 but still does not work.

    And i get too

    Code:
    root@xx:~# rsync -av / rsync://[email protected]:/…66/
    
    Password:
    sending incremental file list
    skipping non-regular file "dev/autofs"
    skipping non-regular file "dev/btrfs-control"
    skipping non-regular file "dev/console"
    skipping non-regular file "dev/cpu_dma_latency"
    skipping non-regular file "dev/cuse"
    skipping non-regular file "dev/fb0"
    skipping non-regular file "dev/full"
    skipping non-regular file "dev/fuse"
    skipping non-regular file "dev/hpet"
    skipping non-regular file "dev/ipmi0"
    skipping non-regular file "dev/kmsg"
    skipping non-regular file "dev/kvm"
    skipping non-regular file "dev/loop-control"
    skipping non-regular file "dev/mem"
    skipping non-regular file "dev/null"
    skipping non-regular file "dev/nvram"
    skipping non-regular file "dev/port"
    skipping non-regular file "dev/ppp"
    skipping non-regular file "dev/psaux"
    skipping non-regular file "dev/ptmx"
    skipping non-regular file "dev/ptp0"
    skipping non-regular file "dev/ptp1"
    skipping non-regular file "dev/random"
    skipping non-regular file "dev/rfkill"
    skipping non-regular file "dev/rtc0"
    skipping non-regular file "dev/sda"
    skipping non-regular file "dev/sda1"
    skipping non-regular file "dev/sdb"
    skipping non-regular file "dev/sdb1"
    skipping non-regular file "dev/sdb2"
    skipping non-regular file "dev/sdb5"
    skipping non-regular file "dev/sg0"
    skipping non-regular file "dev/sg1"
    skipping non-regular file "dev/snapshot"
    skipping non-regular file "dev/tty"
    skipping non-regular file "dev/tty0"
    skipping non-regular file "dev/tty1"
    skipping non-regular file "dev/tty10"
    skipping non-regular file "dev/tty11"
    skipping non-regular file "dev/tty12"
    skipping non-regular file "dev/tty13"
    skipping non-regular file "dev/tty14"
    skipping non-regular file "dev/tty15"
    skipping non-regular file "dev/tty16"
    skipping non-regular file "dev/tty17"
    skipping non-regular file "dev/tty18"
    skipping non-regular file "dev/tty19"
    skipping non-regular file "dev/tty2"
    skipping non-regular file "dev/tty20"
    skipping non-regular file "dev/tty21"
    skipping non-regular file "dev/tty22"
    skipping non-regular file "dev/tty23"
    skipping non-regular file "dev/tty24"
    skipping non-regular file "dev/tty25"
    skipping non-regular file "dev/tty26"
    skipping non-regular file "dev/tty27"
    skipping non-regular file "dev/tty28"
    skipping non-regular file "dev/tty29"
    skipping non-regular file "dev/tty3"
    skipping non-regular file "dev/tty30"
    skipping non-regular file "dev/tty31"
    skipping non-regular file "dev/tty32"
    skipping non-regular file "dev/tty33"
    skipping non-regular file "dev/tty34"
    skipping non-regular file "dev/tty35"
    skipping non-regular file "dev/tty36"
    skipping non-regular file "dev/tty37"
    skipping non-regular file "dev/tty38"
    skipping non-regular file "dev/tty39"
    skipping non-regular file "dev/tty4"
    skipping non-regular file "dev/tty40"
    skipping non-regular file "dev/tty41"
    skipping non-regular file "dev/tty42"
    skipping non-regular file "dev/tty43"
    skipping non-regular file "dev/tty44"
    skipping non-regular file "dev/tty45"
    skipping non-regular file "dev/tty46"
    skipping non-regular file "dev/tty47"
    skipping non-regular file "dev/tty48"
    skipping non-regular file "dev/tty49"
    skipping non-regular file "dev/tty5"
    skipping non-regular file "dev/tty50"
    skipping non-regular file "dev/tty51"
    skipping non-regular file "dev/tty52"
    skipping non-regular file "dev/tty53"
    skipping non-regular file "dev/tty54"
    skipping non-regular file "dev/tty55"
    skipping non-regular file "dev/tty56"
    skipping non-regular file "dev/tty57"
    skipping non-regular file "dev/tty58"
    skipping non-regular file "dev/tty59"
    skipping non-regular file "dev/tty6"
    skipping non-regular file "dev/tty60"
    skipping non-regular file "dev/tty61"
    skipping non-regular file "dev/tty62"
    skipping non-regular file "dev/tty63"
    skipping non-regular file "dev/tty7"
    skipping non-regular file "dev/tty8"
    skipping non-regular file "dev/tty9"
    skipping non-regular file "dev/ttyS0"
    skipping non-regular file "dev/ttyS1"
    skipping non-regular file "dev/ttyS2"
    skipping non-regular file "dev/ttyS3"
    skipping non-regular file "dev/uhid"
    skipping non-regular file "dev/uinput"
    skipping non-regular file "dev/urandom"
    skipping non-regular file "dev/vcs"
    skipping non-regular file "dev/vcs1"
    skipping non-regular file "dev/vcs2"
    skipping non-regular file "dev/vcs3"
    skipping non-regular file "dev/vcs4"
    skipping non-regular file "dev/vcs5"
    skipping non-regular file "dev/vcs6"
    skipping non-regular file "dev/vcsa"
    skipping non-regular file "dev/vcsa1"
    skipping non-regular file "dev/vcsa2"
    skipping non-regular file "dev/vcsa3"
    skipping non-regular file "dev/vcsa4"
    skipping non-regular file "dev/vcsa5"
    skipping non-regular file "dev/vcsa6"
    skipping non-regular file "dev/vcsu"
    skipping non-regular file "dev/vcsu1"
    skipping non-regular file "dev/vcsu2"
    skipping non-regular file "dev/vcsu3"
    skipping non-regular file "dev/vcsu4"
    skipping non-regular file "dev/vcsu5"
    skipping non-regular file "dev/vcsu6"
    skipping non-regular file "dev/vga_arbiter"
    skipping non-regular file "dev/vhci"
    skipping non-regular file "dev/vhost-net"
    skipping non-regular file "dev/vhost-vsock"
    skipping non-regular file "dev/watchdog"
    skipping non-regular file "dev/watchdog0"
    skipping non-regular file "dev/zero"
    skipping non-regular file "dev/bsg/0:0:0:0"
    skipping non-regular file "dev/bsg/1:0:0:0"
    skipping non-regular file "dev/bus/usb/001/001"
    skipping non-regular file "dev/bus/usb/001/002"
    skipping non-regular file "dev/bus/usb/002/001"
    skipping non-regular file "dev/bus/usb/002/002"
    skipping non-regular file "dev/bus/usb/003/001"
    skipping non-regular file "dev/bus/usb/004/001"
    skipping non-regular file "dev/bus/usb/004/002"
    skipping non-regular file "dev/bus/usb/005/001"
    skipping non-regular file "dev/dri/card0"
    skipping non-regular file "dev/hpilo/d0ccb0"
    skipping non-regular file "dev/hpilo/d0ccb1"
    skipping non-regular file "dev/hpilo/d0ccb10"
    skipping non-regular file "dev/hpilo/d0ccb11"
    skipping non-regular file "dev/hpilo/d0ccb12"
    skipping non-regular file "dev/hpilo/d0ccb13"
    skipping non-regular file "dev/hpilo/d0ccb14"
    skipping non-regular file "dev/hpilo/d0ccb15"
    skipping non-regular file "dev/hpilo/d0ccb2"
    skipping non-regular file "dev/hpilo/d0ccb3"
    skipping non-regular file "dev/hpilo/d0ccb4"
    skipping non-regular file "dev/hpilo/d0ccb5"
    skipping non-regular file "dev/hpilo/d0ccb6"
    skipping non-regular file "dev/hpilo/d0ccb7"
    skipping non-regular file "dev/hpilo/d0ccb8"
    skipping non-regular file "dev/hpilo/d0ccb9"
    skipping non-regular file "dev/input/event0"
    skipping non-regular file "dev/input/event1"
    skipping non-regular file "dev/input/mice"
    skipping non-regular file "dev/mapper/control"
    skipping non-regular file "dev/net/tun"
    skipping non-regular file "dev/pts/0"
    skipping non-regular file "dev/pts/ptmx"
    dev/shm/
    dev/shm/rhm.78e172307fe96b3a5513
    dev/shm/rhm.86d5638f7e379120f9bd
    skipping non-regular file "dev/snd/seq"
    skipping non-regular file "dev/snd/timer"
    skipping non-regular file "dev/vfio/vfio"
    file has vanished: "/proc/10/exe"
    file has vanished: "/proc/10/task/10/exe"
    file has vanished: "/proc/100/exe"
    proc/
    proc/kcore
    
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Do not copy /, the root filesystem contains huge files that are not really on the disk. You need to exclude those to make the copy complete in finite time.
    I use BackupPC on my hosts, it uses rsync to copy the files, and has excluded directory trees, for example for one of my hosts:
    Code:
    # These files/paths will be excluded from the backup:
    $Conf{BackupFilesExclude} = {
          '/var/lib/backuppc' => [],
          '*' => [
                  '/proc',
                  '/dev',
                  '/cdrom',
                  '/media',
                  '/floppy',
                  '/mnt',
                  '/lost+found',
                  '/temp',
                  '/sys',
                  '/tmp',
                  '/var/lib/backuppc'
                ]
        };
    
    
    Adapt that to your rsync exclude statement.
    So the external disk is on a remote host? Try first ssh someuser@remotehost, when that works try rsync.
    I noticed you are copying to / on the remote host. Surely that is not what you want? Target should be directory where the external disk is mounted.
     
    Last edited: Jun 14, 2023
    ahrasis likes this.
  3. pecka33

    pecka33 Member

    Thank you. So i use
    apt install backuppc to install and all set in admin panel. I hope that i could set there external disk/server to backup
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    So you started using backuppc? And you installed backuppc on the host with the external disk?
    Were you all the time using BackupPC and experimenting with ssh command for backuppc configuration? I am confused, just installing backuppc does not do much, it is rather laborious to configure and test the backups are OK.
     
  5. pecka33

    pecka33 Member

    Thank you. Yes, i am using on my PC linux too and tried to install and use backuppc. Does not work well for me, i set up host where i would like to test backup, but does not work.
    Is here any way how can i backup complete folders and files in / without exclude statement with rsync command ?

    When i used standard rsync i get still skipping non-regular file
     
  6. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    If you need advice on installing and setting up BackupPC, please start a new thread for that. This thread gets confusing if it is not obvious when discussing rsync and when backuppc.
    I'll deal only with using rsync from now on.
    I can not see how there could be. Why this desire to avoid using exclude statement? On Unix and Linux, file system has numerous "files" that are not real files, trying to back them up just makes a mess.
    If you are trying to create exact copy of the file system that can be restored on another host and boot up, rsync and BackupPC is not suitable. They back up files, and can restore all files or individual files. To restore complete file system, you need image copy, application like Clonezilla https://clonezilla.org/ for example could be used. However, using it remotely to do the image copy is not possible, as far as I know. You would need to create a boot medium with Clonezilla, and boot the host up with that, then run clonezilla.
    Back to the rsync problem: It should work to back up files on the situation you have described. I would run rsync on the host with the external disk, but it should work both ways.
    You should exclude the /dev directory so rsync does not try to access them. rsync skips them because they can not be copied sensibly, so good thing there.
     
  7. pecka33

    pecka33 Member

    Thank you. So in case i used clonezille to backup my server, i get image of my server which i can restore anytime. Containts this image complete files of my server, include www, databases etc.?
     
  8. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    It does not contain files, it is the image copy of the file system, and you can not restore individual files. You can restore the file system to the state it was when copied. This kind of backup is pretty much useless as a server backup, unless you have another backup method that does back up file by file and can restore individual files.
    Why not read Clonezilla web page, it explains better than I can what it is and what it does.
     
  9. pecka33

    pecka33 Member

    Thank you, i am going to read it.

    My target is to do complete backup of my dedicated debian server with all files include websites, ispconfig settings etc. So get complete backup of my server and in case my server going to down, broke or something like that, take this backup, upload it and my server will be working as before with all files, websites...
     
  10. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    not a good idea to do it that way.. unless you're making a complete backup every night..
    in which case the backup window, and the restore time are likely to be problems anyway..

    better to back up critical files and data only..
    if you, or your hoster is running a system that allows you to snapshot your server, or disks. that would be a quicker backup/restore option.

    if it's a vm / vps, an option is to create an image of an newly installed and configured server.. or create an install script to install all the required software onto a blank new server.. and use either of those to quickly bring up a new server instance when needed. then restore the daily backed up application configs, user accounts, and data to the new server.

    a complete server image of a remote server backed up locally is a bad backup option... not only is it a slow and unreliable way to backup. it's an even slower, and more unreliable way to restore. it's also not a backup unless you have some way to confirm you can restore it in the way required.
     

Share This Page