Skip to content

Instantly share code, notes, and snippets.

@JayaByu
Last active August 14, 2023 04:58
Show Gist options
  • Save JayaByu/88a15b0d60d9e472a6cb6e0831f62fd4 to your computer and use it in GitHub Desktop.
Save JayaByu/88a15b0d60d9e472a6cb6e0831f62fd4 to your computer and use it in GitHub Desktop.

Backup Lab & Recovery

NFS Share

Cek Windows server -> Install NFS Server

Create Directory NFS Share (input IP permission linux) (dir name [NFS_Backup])

Linux NFS Connect

~: mkdir nfsbackup 
~: mount 192.168.20.100:/NFS_Backup /nfsbackup (/dir in Windows /dir in linux)

Biar rapih

~: cek hostname biar sesuai host name
~: mkdir nfsbackup/hostname

SMB Share

Cek Windows server

Create Directory SMB Share to share on linux (dir name [SMB_Backup])

Install package for connect to smb

~: apt install cifs-utils
~: apt install smb-client

Linux SMB connect

~: mkdir smbbackup

Create configuration at /etc/fstab

~: sudo vim /etc/fstab

Config

       <file system>                  <mount point>       <type>                 <option>                    <dump>    <pass>
//192.168.20.100/SMB_Backup     /home/artemis/smbbackup    cifs   username=administrator,password=p@ssw0rd      0         0

image

mount confg

~: mount -a 

cek is connect or not

:~ df -h

image

Backup With rsync

Backup from dir NFS or SMB

--exclude={/dir will not backup/*,}

~: sudo rsync -aAXv --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found/*,smbbackup||nfsbackup/*} /* smbbackup||nfsbackup/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment