Transfer (sync) a backup to a remote location using Rsync through a SSH tunnel between 2 Asus routers - XIYO/asuswrt-merlin.ng-kr GitHub Wiki


๋” ๋‚˜์•„๊ฐ€๊ธฐ ์ „์—, ๋‚ด์žฅ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ๋” ์ข‹์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค (์ž‘๋™ํ•œ๋‹ค๋ฉด): ๋‚ด์žฅ๊ธฐ๋Šฅ

***# Translate Error

In the following tutorial/guide, we will learn how to setup the transfer (sync) of a backup to a remote site using a ssh tunnel between 2 ASUS routers with Rsync as transporter.

Context:

  • on a site (1080), someone makes a daily backup of all his PCs important files on the local router usb disk .
  • on another site (8075), someone else makes a daily backup of all his PCs important files on the local router usb disk.
  • each of them wants to place a copy of his local backups to a remote site, meaning that each of them wants to daily transfer his backups to the other router usb disk.
  • when possible, all commands come from 1080.

If you want something different, please adapt the rsync commands and the scripts to your needs.

Rsync is a "classic" linux program used to synchronize/copy efficiently data between two locations.

"Rsync is a fast and extraordinarily versatile file copying tool. It can copy locally, to/from another host over any remote shell, or to/from a remote rsync daemon. It offers a large number of options that control every aspect of its behavior and permit very flexible specification of the set of files to be copied. It is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. Rsync is widely used for backups and mirroring and as an improved copy command for everyday use.

Rsync finds files that need to be transferred using a "quick check" algorithm (by default) that looks for files that have changed in size or in last-modified time. Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file's data does not need to be updated."

The source and the destination could be "local", on the same server/router, but our goal being to secure a backup, we will do it to a remote location. We will also secure the transfer itself by using SSH . Secure Shell (SSH) is a cryptographic network protocol for secure data communication, remote command-line login, remote command execution, etc. To make it even more secure, we will use a private/public key schema (instead of id/password).

In my specific case, the routers are named:

  • RT-1080 (the local)
  • RT-8075 (the remote)

Both need Rsync installed. RT-1080 is the "master", i.e. the one responsible for all actions going on between the 2 routers, and RT-8075 is the "slave", just reacting to RT-1080 requests. In my specific case, each router has a 4TB USB3 disk (on the USB3 port, indeed), and each disk has 2 partitions:

  • the "data partition" (~4TB)
  • the "router partition" (~5GB)

Please note that you don't absolutely need the "router partition", and for the purpose of this tutorial, we will consider that there is just one disk with one partition

To Rsync, you will possibly need a swap space because the router memory could be too limited for the process, depending on the size of the backup. If required, the swap space could be set on a file located on the router partition, or more simply on the main disk, and Optware/rsync could also be installed on that partition. As mentioned, for this tutorial everything will be installed on the main partition.

Simply said, Optware is a mechanism that simplifies the installation of some programs on the router.

The data partition will contain:

  • the local backup: bckp-1080
  • the remote backup: bckp-8075
  • the backup logs: bckp-logs

In my specific case, Windows File History is the tool used to backup two local PC on RT-1080, and same thing on the remote side, on RT-8075. The goal was therefore to send bckp-1080 to RT-8075, and bckp-8075 to RT-1080. The backups are scheduled to run daily at night using CRON. CRON is the standard Linux tool used to schedule processes on a periodic way. The CRU command will be used to setup the CRON job:

CRU= Cron Utility add: cru a <"min hour day month week command"> delete: cru d list: cru l

I also use:

  • JFFS,

  • fstab, one of the Custom config files and

  • the "User scripts" of RMerlin firmware version. Two user scripts will be setup:

  • init-start

  • post-mount

  • plus 3 other scripts:

  • transfert-bckp-1080.sh to handle the 1080 backup transfer to RT-8075

  • transfert-bckp-8075.sh to handle the 8075 backup transfer to RT-1080

  • mail.sh to notify by email users of the result of the transfers.

JFFS is a writable section of the flash memory used to store some user's data/program/scripts. Intrinsically, the router is a device with no permanent memory, memory being erased on each shutdown, with the exception of the JFFS space. Please note that the JFFS space has to be also backup because it could be overwritten by a new firmware version.

Fstab is a linux configuration file used to mount the disks. This file will be stored in the folder Config located under JFFS. The User's Scripts are event-triggered and will be used to initiate some actions on the router reboot, and on the post-mount of the disk/partitions. The User's scripts are located under the folder "scripts" also under JFFS. Therefore, when backing up the JFFS space, at the same time I backup fstab and the scripts.

I will go first with the most simplest approach:

  • using the backup disk as "system disk", meaning that we will use the usb backup disk to install all the required elements.
  • not creating the swap space (because it could be not required if your backup is not "that big").

***# Translate Error

Procedure:


On RT-1080 (local router):

  • Connect a USB disk (ideally usb 3) on one of the usb port (ideally the usb 3 port if you use a usb3 disk...)
  • Select "USB Applications" on the main menu of the GUI.
  • Select "Media Services and Servers" on the new page
  • Select the tab labeled: "Network Place"
  • Turn on "Enable Share" (4)
  • For sake of simplicity at this moment, select "Allow guest login".(5) You can change it later and give specific rights to specific persons)
  • Enter your specific "Work group" (6)
  • Apply the changes (7) CreateShares1 a

That done, on the same page, on the bottom part:

  • Select the main disk (1)
  • Create a share/folder "bckp-1080" for the local backup (2)
  • Create a share/folder "bckp-8075" for storing the remote backup (2)
  • Create a share/folder "bckp-logs for storing the logs of the backup processes (2)
  • Optionally create a share/folder "Router" for the route/system needs (2)
  • Apply the changes (3) a

Enable ssh and jffs and format jffs

  • Select Administration on the left menu (1)

  • Select System tab (2)

  • Enable JFFS partition (3)

  • Ask to format the JFFS partition at the next boot (4)

  • Enable SSH (5)

  • Apply the changes ()

  • JFFS&SSH

  • Reboot the router (to apply the jffs formating)

  • boot

  • Install Optware (by installing, and then removing, Download Master if this application is not required). Optware is required to install Rsync.

  • a

    • Depending if at this moment you have one or two usb devices connected to the router, the router will propose one or two usb devices to make the installation. Select the main one and proceed.
  • a

  • a

    • Depending if you really need Download Master (a tool mainly used to download torrents ?), you can uninstall it right away. This procedure was just the easiest way to install Optware (by installing Download Master, you automatically install Optware).
  • a



  • Install a terminal emulator to access the routers (Putty or Xshell) on your PC

Optionally you can also install WinSCP on your PC to create folders and edit the files on the router (instead of using a line editor like vi or nano on the terminal emulator)

  • "Connect" the terminal emulator to the router (usually 192.168.1.1, or router.asus.com)

  • Using the terminal emulator (or WINscp), create 3 sub-folders to the jffs folder:

  • config

  • scripts

  • dropbear

  • In the scripts folder, create the file post-mount . This script is called after a disk is mounted. You may have to check which disk just get mounted, That's why there is a "IF" section. Here is my own script. If you adapt it, please replace aaaa with the router admin id, XXXX with the remote router port number, and ZZZZ with the remote router ddns name). You can also remove completely the first "IF" section if there is no other partition on the main USB connected disk.

#!/bin/sh

#Start of the optional section (used if you have a second partition on the disk)`
if [  = "/tmp/mnt/RT-1080_rt" ]    # check if it is the post-mount of the partition reserved for the router. If you don't have it, this doesn't cause any problem. If you have it, and if a swap space is required, we will create that space here, in that partition [NOT USED FOR THE TUTORIAL]
then
#Turn on the swap space
swapon /tmp/mnt/RT-1080_rt/myswapfile
#Set the _swappiness _ . This is the parameter that decice how aggressive is the swapping process. Could be set from 0 to 100. At 0 the router won't swap unless it hits the "no more available memory" state. By default: 60
echo 20 > /proc/sys/vm/swappiness
fi
#End of the optional section (used if you have a second partition on the disk). If you don't need it, just delete the lines starting at "Start of the optional section..."

if [  = "/tmp/mnt/RT-1080" ]    # check if it is the post-mount of the main disk
then
#Turn on the swap space for the case where the swap space have been created directly on the main disk
swapon /tmp/mnt/RT-1080/myswapfile

#Set the _swappiness _ . This is the parameter that decide how aggressive is the swapping process. Could be set from 0 to 100. At 0 the router won't swap unless it hits the "no more available memory" state. By default: 60
echo 20 > /proc/sys/vm/swappiness

#first, bring back the "known_hosts"
rsync -avz --log-file=/mnt/RT-1080/Backup-logs/backup-known_hosts.log /mnt/RT-1080/bckp-1080/Router/ssh/ /root/.ssh

#schedule the transfer of bckp-1080 to RT-8075. Here will be done daily at midnight:
cru a backup1080to8075 "0 0 * * * /jffs/scripts/transfert-bckp-1080.sh"

#schedule the transfer of bckp-8075 to RT-1080. Here will be done daily at 04h00:
cru a backup8075to1080 "0 4 * * * /jffs/scripts/transfert-bckp-8075.sh"

#make a backup of RT-1080 **jffs** a few times a day
cru a backupjffs1080 "0 8,12,18,23 * * * rsync -av --log-file=/mnt/RT-1080/Backup-logs/rsync-jffs-1080.log  /jffs /mnt/RT-1080/bckp-1080/Router"

#make a backup of RT-8075 **jffs** a few times a day
cru a backupjffs8075 "30 8,12,18,23 * * * rsync -avz -e 'ssh -p XXXX-i /jffs/dropbear/rsa_id' --log-file=/mnt/RT-1080/Backup-logs/rsync-jffs-8075.log  [email protected]:/jffs /mnt/RT-1080/bckp-8075/Router"

#make a backup of RT-1080 "known_hosts" a few times a day
cru a backupknown_hosts "45 8,12,18,23 * * * rsync -avz --log-file=/mnt/RT-1080/Backup-logs/backup-known_hosts.log  /root/.ssh/ /mnt/RT-1080/bckp-1080/Router/ssh"
fi
exit $?
์ด ์Šคํฌ๋ฆฝํŠธ๋“ค์€ ASUS ๋ผ์šฐํ„ฐ์—์„œ ๋ฐฑ์—… ์ „์†ก์„ ์ž๋™ํ™”ํ•˜๊ธฐ ์œ„ํ•œ ๊ฒƒ์ž…๋‹ˆ๋‹ค. ๊ฐ ์Šคํฌ๋ฆฝํŠธ๋Š” ํŠน์ • ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๋ฉฐ, ์‚ฌ์šฉ์ž์˜ ํ™˜๊ฒฝ์— ๋งž๊ฒŒ ์กฐ์ •๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

1. **init-start ์Šคํฌ๋ฆฝํŠธ**:
   - ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ๋‘ ๊ฐœ์˜ ๋งˆ์šดํŠธ ํฌ์ธํŠธ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค: ํ•˜๋‚˜๋Š” ๋ฉ”์ธ ํŒŒํ‹ฐ์…˜์šฉ์ด๊ณ , ๋‹ค๋ฅธ ํ•˜๋‚˜๋Š” ๋ผ์šฐํ„ฐ ํŒŒํ‹ฐ์…˜์šฉ์ž…๋‹ˆ๋‹ค.
   - ๋‹จ์ผ ๋””์Šคํฌ์™€ ๋‹จ์ผ ํŒŒํ‹ฐ์…˜์ด ์žˆ๋Š” ๊ฒฝ์šฐ, ๋‘ ๋ฒˆ์งธ ๋ช…๋ น์–ด ์•ž์— "#"์„ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ํ•ด๋‹น ์ค„์„ ์‚ญ์ œํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

2. **transfert-bckp-1080 ์Šคํฌ๋ฆฝํŠธ**:
   - ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ๋กœ์ปฌ ๋ฐฑ์—…(1080)์„ ์›๊ฒฉ ๋ผ์šฐํ„ฐ(8075)๋กœ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
   - `????`์™€ `??????.asuscomm.com`์€ ์‹ค์ œ SSH ํฌํŠธ ๋ฒˆํ˜ธ์™€ ์›๊ฒฉ ๋ผ์šฐํ„ฐ์˜ ์ฃผ์†Œ๋กœ ๋Œ€์ฒดํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
   - ๋กœ๊ทธ ํŒŒ์ผ์˜ ๊ฒฝ๋กœ์™€ ์ด๋ฆ„์ด ์„ค์ •๋˜๋ฉฐ, `rsync` ๋ช…๋ น์„ ํ†ตํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ๋™๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค.
   - ์ „์†ก ์™„๋ฃŒ ํ›„, `mail.sh` ์Šคํฌ๋ฆฝํŠธ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์ „์†ก ๊ฒฐ๊ณผ๋ฅผ ์ด๋ฉ”์ผ๋กœ ๋ณด๋ƒ…๋‹ˆ๋‹ค.

3. **transfert-bckp-8075 ์Šคํฌ๋ฆฝํŠธ**:
   - ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ์›๊ฒฉ ๋ฐฑ์—…(8075)์„ ๋กœ์ปฌ ๋ผ์šฐํ„ฐ(1080)๋กœ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
   - ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ `????`์™€ `?????.asuscomm.com`์€ ์‹ค์ œ SSH ํฌํŠธ ๋ฒˆํ˜ธ์™€ ์›๊ฒฉ ๋ผ์šฐํ„ฐ์˜ ์ฃผ์†Œ๋กœ ๋Œ€์ฒดํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
   - ๋กœ๊ทธ ํŒŒ์ผ์˜ ๊ฒฝ๋กœ์™€ ์ด๋ฆ„์ด ์„ค์ •๋˜๋ฉฐ, `rsync` ๋ช…๋ น์„ ํ†ตํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ๋™๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค.
   - ์ „์†ก ์™„๋ฃŒ ํ›„, `mail.sh` ์Šคํฌ๋ฆฝํŠธ๋ฅผ ํ˜ธ์ถœํ•˜์—ฌ ์ „์†ก ๊ฒฐ๊ณผ๋ฅผ ์ด๋ฉ”์ผ๋กœ ๋ณด๋ƒ…๋‹ˆ๋‹ค.

์ด ์Šคํฌ๋ฆฝํŠธ๋“ค์€ ๊ฐ ๋ผ์šฐํ„ฐ์˜ ํ™˜๊ฒฝ๊ณผ ๋„คํŠธ์›Œํฌ ์„ค์ •์— ๋งž๊ฒŒ ์ˆ˜์ •๋˜์–ด์•ผ ํ•˜๋ฉฐ, ์ •ํ™•ํ•œ ์ฃผ์†Œ, ํฌํŠธ ๋ฒˆํ˜ธ, ์‚ฌ์šฉ์ž ์ด๋ฆ„ ๋“ฑ์„ ํฌํ•จํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ, ์ด๋ฉ”์ผ ์ „์†ก์„ ์œ„ํ•œ `mail.sh` ์Šคํฌ๋ฆฝํŠธ์˜ ๊ฒฝ๋กœ์™€ ์„ค์ •๋„ ์ ์ ˆํ•˜๊ฒŒ ์กฐ์ •๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
์ด `mail.sh` ์Šคํฌ๋ฆฝํŠธ๋Š” ์ด์ „์˜ `transfert-bckp-xxxx.sh` ์Šคํฌ๋ฆฝํŠธ์—์„œ ํ˜ธ์ถœ๋˜์–ด ์‚ฌ์šฉ์ž์—๊ฒŒ ์ด๋ฉ”์ผ์„ ํ†ตํ•ด ๋ฐฑ์—… ๊ฒฐ๊ณผ๋ฅผ ์•Œ๋ฆฝ๋‹ˆ๋‹ค. ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ๊ฐ„๋‹จํ•œ ๋ฉ”์ผ ํด๋ผ์ด์–ธํŠธ ๊ธฐ๋Šฅ์„ ์ˆ˜ํ–‰ํ•˜๋ฉฐ, ํŠน์ • ์ด๋ฉ”์ผ ์„œ๋ฒ„๋ฅผ ํ†ตํ•ด ๋ฉ”์‹œ์ง€๋ฅผ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.

1. **์Šคํฌ๋ฆฝํŠธ ์„ค์ •**:
   - `SMTP`, `USER`, `PASS` ๋ณ€์ˆ˜๋Š” ์‹ค์ œ ์ด๋ฉ”์ผ ์„œ๋ฒ„์˜ ์ฃผ์†Œ, ์‚ฌ์šฉ์ž ์ด๋ฆ„, ๋น„๋ฐ€๋ฒˆํ˜ธ๋กœ ๋Œ€์ฒดํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
   - `FROM`๊ณผ `TO` ๋ณ€์ˆ˜๋Š” ๋ฉ”์ผ ๋ฐœ์‹ ์ž์™€ ์ˆ˜์‹ ์ž์˜ ์ด๋ฉ”์ผ ์ฃผ์†Œ๋ฅผ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
   - ์Šคํฌ๋ฆฝํŠธ๋Š” ์ œ๊ณต๋œ ๋กœ๊ทธ ํŒŒ์ผ์„ ์ด๋ฉ”์ผ ๋ณธ๋ฌธ์— ํฌํ•จ์‹œํ‚ต๋‹ˆ๋‹ค.

2. **์ด๋ฉ”์ผ ๋ฉ”์‹œ์ง€ ๊ตฌ์„ฑ**:
   - ๋ฉ”์ผ์˜ ์ œ๋ชฉ, ๋ฐœ์‹ ์ž, ๋‚ ์งœ ๋“ฑ์ด ์„ค์ •๋ฉ๋‹ˆ๋‹ค.
   - ๋ฉ”์ผ ๋ณธ๋ฌธ์—๋Š” ๋ฐฑ์—… ํ”„๋กœ๊ทธ๋žจ์˜ ์ด๋ฆ„๊ณผ ์™„๋ฃŒ ์‹œ๊ฐ„, ๋กœ๊ทธ ํŒŒ์ผ์˜ ๋‚ด์šฉ์ด ํฌํ•จ๋ฉ๋‹ˆ๋‹ค.

3. **์ด๋ฉ”์ผ ์ „์†ก**:
   - `/usr/sbin/sendmail` ๋ช…๋ น์„ ์‚ฌ์šฉํ•˜์—ฌ ๋ฉ”์ผ์„ ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
   - ์Šคํฌ๋ฆฝํŠธ๋Š” ๋ฉ”์ผ์„ ํ…Œ์ŠคํŠธํ•˜๊ธฐ ์œ„ํ•œ 'verbose' ๋ชจ๋“œ์™€ ์‹ค์ œ ์šด์˜์„ ์œ„ํ•œ 'silent' ๋ชจ๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

4. **์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰ ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋งŒ๋“ค๊ธฐ**:
   - ์Šคํฌ๋ฆฝํŠธ ํŒŒ์ผ์ด ์ƒ์„ฑ๋œ ํ›„, SSH ํ„ฐ๋ฏธ๋„ ์—๋ฎฌ๋ ˆ์ดํ„ฐ์—์„œ ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ์Šคํฌ๋ฆฝํŠธ ํŒŒ์ผ์„ ์‹คํ–‰ ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋งŒ๋“ญ๋‹ˆ๋‹ค:
     ```
     chmod a+rx /jffs/scripts/*
     ```

5. **config ํด๋”์— fstab ํŒŒ์ผ ์ƒ์„ฑ**:
   - `fstab` ํŒŒ์ผ์€ ์‹œ์Šคํ…œ ๋ถ€ํŒ… ์‹œ ์ž๋™์œผ๋กœ ๋งˆ์šดํŠธํ•  ํŒŒ์ผ ์‹œ์Šคํ…œ์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ์ด ํŒŒ์ผ์˜ ๋‚ด์šฉ์€ ์‚ฌ์šฉ์ž์˜ ๋ผ์šฐํ„ฐ ์„ค์ •๊ณผ ์—ฐ๊ฒฐ๋œ ์Šคํ† ๋ฆฌ์ง€์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
   - ํ•ด๋‹น ๋‚ด์šฉ์„ ์ œ๊ณตํ•˜์‹œ๋ฉด, ๊ตฌ์ฒด์ ์ธ ๋„์›€์„ ๋“œ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ์Šคํฌ๋ฆฝํŠธ๋“ค์€ ๋ผ์šฐํ„ฐ์—์„œ ์ž๋™ ๋ฐฑ์—…๊ณผ ์ด๋ฉ”์ผ ์•Œ๋ฆผ ๊ธฐ๋Šฅ์„ ๊ตฌํ˜„ํ•˜๊ธฐ ์œ„ํ•ด ํ•จ๊ป˜ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ํ™˜๊ฒฝ์— ๋งž๊ฒŒ ์ •ํ™•ํ•œ ์„œ๋ฒ„ ์ฃผ์†Œ, ์‚ฌ์šฉ์ž ์ด๋ฆ„, ๋น„๋ฐ€๋ฒˆํ˜ธ, ์ด๋ฉ”์ผ ์ฃผ์†Œ ๋“ฑ์„ ์„ค์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
์ด ๋‹จ๊ณ„์—์„œ๋Š” `fstab` ํŒŒ์ผ์„ ๊ตฌ์„ฑํ•˜๊ณ  `Rsync`๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค. 

1. **fstab ํŒŒ์ผ ๊ตฌ์„ฑ**:
   - `fstab` ํŒŒ์ผ์€ ๋ถ€ํŒ… ์‹œ ์ž๋™์œผ๋กœ ํŒŒ์ผ ์‹œ์Šคํ…œ์„ ๋งˆ์šดํŠธํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.
   - ์ด ์˜ˆ์‹œ์—์„œ๋Š” ๋‘ ๊ฐœ์˜ NTFS ํŒŒํ‹ฐ์…˜์„ ๋งˆ์šดํŠธํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ณด์—ฌ์ค๋‹ˆ๋‹ค: ํ•˜๋‚˜๋Š” ๋ฐฑ์—… ๋””์Šคํฌ์šฉ(`RT-1080`), ๋‹ค๋ฅธ ํ•˜๋‚˜๋Š” ์„ ํƒ์ ์ธ ๋ผ์šฐํ„ฐ ํŒŒํ‹ฐ์…˜์šฉ(`RT-1080_rt`).
   - `UUID`๋Š” ๊ณ ์œ ํ•œ ๋””์Šคํฌ ์‹๋ณ„์ž๋กœ, `/dev/sda1`๊ณผ ๊ฐ™์€ ์žฅ์น˜ ๊ฒฝ๋กœ ๋Œ€์‹  ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. `UUID`๋Š” `blkid` ๋ช…๋ น์„ ํ†ตํ•ด ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
   - ๊ฐ ๋ผ์ธ์€ ๋งˆ์šดํŠธํ•  ๋””์Šคํฌ์˜ `UUID`, ๋งˆ์šดํŠธ ํฌ์ธํŠธ, ํŒŒ์ผ ์‹œ์Šคํ…œ ์œ ํ˜•, ๋งˆ์šดํŠธ ์˜ต์…˜ ๋“ฑ์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.

2. **Rsync ์„ค์น˜**:
   - Rsync๋Š” ํŒŒ์ผ ๋™๊ธฐํ™”์™€ ๋ฐฑ์—…์— ์‚ฌ์šฉ๋˜๋Š” ๊ฐ•๋ ฅํ•œ ๋„๊ตฌ์ž…๋‹ˆ๋‹ค.
   - SSH ํ„ฐ๋ฏธ๋„์—์„œ ๋‹ค์Œ ๋ช…๋ น์„ ์‹คํ–‰ํ•˜์—ฌ Rsync๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค:
     ```
     ipkg upgrade
     ipkg install rsync
     ```
   - `ipkg`๋Š” Optware ํŒจํ‚ค์ง€ ๊ด€๋ฆฌ์ž๋กœ, Optware๋ฅผ ํ†ตํ•ด ์„ค์น˜๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

์ด ๊ณผ์ •์€ ๋ผ์šฐํ„ฐ์˜ ๋ฐฑ์—… ์‹œ์Šคํ…œ์„ ์„ค์ •ํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ ํ•„์ˆ˜์ ์ธ ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค. `fstab` ํŒŒ์ผ ์„ค์ •์€ ๋””์Šคํฌ์™€ ๋ผ์šฐํ„ฐ ์„ค์ •์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ, ์ •ํ™•ํ•œ `UUID`๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  `Rsync` ์„ค์น˜๋Š” ๋ฐฑ์—… ๋ฐ์ดํ„ฐ์˜ ๋™๊ธฐํ™”์™€ ์ „์†ก์„ ์œ„ํ•ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.
์ด ์ง€์นจ์€ RT-8075 (์›๊ฒฉ ๋ผ์šฐํ„ฐ)์—์„œ SSH, JFFS๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ณ , USB ๋””์Šคํฌ๋ฅผ ์—ฐ๊ฒฐํ•˜๊ณ , ๋„คํŠธ์›Œํฌ ๊ณต์œ ๋ฅผ ์„ค์ •ํ•˜๋Š” ๊ณผ์ •์„ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ, `post-mount` ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋””์Šคํฌ๊ฐ€ ๋งˆ์šดํŠธ๋œ ํ›„ ํ•„์š”ํ•œ ์„ค์ •์„ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค.

1. **SSH ๋ฐ JFFS ํ™œ์„ฑํ™” ๋ฐ ํฌ๋งท**:
   - **Administration**์—์„œ **System** ํƒญ์œผ๋กœ ์ด๋™ํ•˜์—ฌ JFFS ํŒŒํ‹ฐ์…˜์„ ํ™œ์„ฑํ™”ํ•˜๊ณ  ๋‹ค์Œ ๋ถ€ํŒ… ๋•Œ ํฌ๋งทํ•˜๋„๋ก ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
   - SSH๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ณ , WAN์—์„œ์˜ SSH ์ ‘์†์„ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค.
   - SSH ๋กœ๊ทธ์ธ์„ ๋น„ํ™œ์„ฑํ™”ํ•˜๊ณ  (๊ฐœ์ธ/๊ณต๊ฐœ ํ‚ค ์‚ฌ์šฉ ์˜ˆ์ •), ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.

2. **USB ๋””์Šคํฌ ์—ฐ๊ฒฐ ๋ฐ ๋„คํŠธ์›Œํฌ ๊ณต์œ  ์„ค์ •**:
   - USB ๋””์Šคํฌ๋ฅผ ์—ฐ๊ฒฐํ•˜๊ณ , **USB Applications**์—์„œ **Media Services and Servers**๋กœ ์ด๋™ํ•œ ๋‹ค์Œ **Network Place** ํƒญ์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค.
   - "Enable Share"๋ฅผ ํ™œ์„ฑํ™”ํ•˜๊ณ , "Allow guest login"์„ ์„ ํƒํ•ฉ๋‹ˆ๋‹ค (๋‚˜์ค‘์— ๋ณ€๊ฒฝ ๊ฐ€๋Šฅ).
   - ์›ํ•˜๋Š” "Work group"์„ ์ž…๋ ฅํ•˜๊ณ  ๋ณ€๊ฒฝ ์‚ฌํ•ญ์„ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.
   - ๋ฉ”์ธ ๋””์Šคํฌ๋ฅผ ์„ ํƒํ•˜๊ณ  ํ•„์š”ํ•œ ๊ณต์œ  ํด๋”๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.

3. **Asus DDNS ์ƒ์„ฑ**:
   - Asus DDNS(์˜ˆ: xxx.asuscomm.com)๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์›๊ฒฉ ๋ผ์šฐํ„ฐ์— "์˜๊ตฌ์ " URL์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.

4. **post-mount ์Šคํฌ๋ฆฝํŠธ ์„ค์ •**:
   - ํ„ฐ๋ฏธ๋„ ์—๋ฎฌ๋ ˆ์ดํ„ฐ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ `jffs` ํด๋”์— `config` ๋ฐ `scripts` ํ•˜์œ„ ํด๋”๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
   - `scripts` ํด๋”์— `post-mount` ํŒŒ์ผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ๋””์Šคํฌ๊ฐ€ ๋งˆ์šดํŠธ๋œ ํ›„ ํ˜ธ์ถœ๋˜๋ฉฐ, ํ•„์š”์— ๋”ฐ๋ผ ์ˆ˜์ •ํ•ด์•ผ ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.
   - ์Šคํฌ๋ฆฝํŠธ ๋‚ด `if [  = "/tmp/mnt/RT-8075" ]` ๋ถ€๋ถ„์— ์กฐ๊ฑด์„ ์ฑ„์›Œ์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, `if [ "$1" = "/tmp/mnt/RT-8075" ]`์ฒ˜๋Ÿผ `$1`์„ ์ถ”๊ฐ€ํ•˜์—ฌ ์ฒซ ๋ฒˆ์งธ ์ธ์ž(๋งˆ์šดํŠธ๋œ ๊ฒฝ๋กœ)๋ฅผ ํ™•์ธํ•˜๋„๋ก ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
   - ์Šค์™‘ ๊ณต๊ฐ„์„ ์„ค์ •ํ•˜๊ณ , ํ•„์š”ํ•œ ๊ฒฝ์šฐ `swappiness` ๊ฐ’์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.

์ด ๊ณผ์ •์€ ์›๊ฒฉ ๋ผ์šฐํ„ฐ์˜ ๋ฐฑ์—…๊ณผ ๋„คํŠธ์›Œํฌ ๊ณต์œ  ๊ธฐ๋Šฅ์„ ์„ค์ •ํ•˜๋Š” ๋ฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. ์Šคํฌ๋ฆฝํŠธ์™€ ์„ค์ •์€ ๋ผ์šฐํ„ฐ์˜ ํŠน์ • ์š”๊ตฌ ์‚ฌํ•ญ๊ณผ ํ™˜๊ฒฝ์— ๋งž๊ฒŒ ์กฐ์ •๋˜์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
์ด ์ง€์นจ์€ RT-8075 (์›๊ฒฉ ๋ผ์šฐํ„ฐ)์—์„œ `init-start` ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์ƒ์„ฑํ•˜๊ณ , ์ด๋ฅผ ์‹คํ–‰ ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋งŒ๋“ค๋ฉฐ, `fstab` ํŒŒ์ผ์„ ์„ค์ •ํ•˜๋Š” ๊ณผ์ •์„ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค.

1. **init-start ์Šคํฌ๋ฆฝํŠธ ์ƒ์„ฑ**:
   - `scripts` ํด๋”์— `init-start` ํŒŒ์ผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
   - ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” ๋‘ ๊ฐœ์˜ ๋งˆ์šดํŠธ ํฌ์ธํŠธ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค: ํ•˜๋‚˜๋Š” ๋ฉ”์ธ ํŒŒํ‹ฐ์…˜์šฉ์ด๊ณ , ๋‹ค๋ฅธ ํ•˜๋‚˜๋Š” ๋ผ์šฐํ„ฐ ํŒŒํ‹ฐ์…˜์šฉ์ž…๋‹ˆ๋‹ค.
   - ๋‹จ์ผ ๋””์Šคํฌ์™€ ๋‹จ์ผ ํŒŒํ‹ฐ์…˜์ด ์žˆ๋Š” ๊ฒฝ์šฐ, ๋ผ์šฐํ„ฐ ํŒŒํ‹ฐ์…˜์šฉ ๋งˆ์šดํŠธ ํฌ์ธํŠธ ์ƒ์„ฑ ๋ช…๋ น์–ด ์•ž์— "#"์„ ์ถ”๊ฐ€ํ•˜๊ฑฐ๋‚˜ ํ•ด๋‹น ์ค„์„ ์‚ญ์ œํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

2. **์Šคํฌ๋ฆฝํŠธ ์‹คํ–‰ ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋งŒ๋“ค๊ธฐ**:
   - ์Šคํฌ๋ฆฝํŠธ ํŒŒ์ผ์ด ์ƒ์„ฑ๋œ ํ›„, SSH ํ„ฐ๋ฏธ๋„ ์—๋ฎฌ๋ ˆ์ดํ„ฐ์—์„œ ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ์Šคํฌ๋ฆฝํŠธ ํŒŒ์ผ์„ ์‹คํ–‰ ๊ฐ€๋Šฅํ•˜๊ฒŒ ๋งŒ๋“ญ๋‹ˆ๋‹ค:
     ```
     chmod a+rx /jffs/scripts/*
     ```

3. **fstab ํŒŒ์ผ ์ƒ์„ฑ**:
   - `config` ํด๋”์— `fstab` ํŒŒ์ผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
   - `fstab` ํŒŒ์ผ์€ ๋ถ€ํŒ… ์‹œ ์ž๋™์œผ๋กœ ํŒŒ์ผ ์‹œ์Šคํ…œ์„ ๋งˆ์šดํŠธํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.
   - `UUID`๋Š” ๊ณ ์œ ํ•œ ๋””์Šคํฌ ์‹๋ณ„์ž๋กœ, `/dev/sda1`๊ณผ ๊ฐ™์€ ์žฅ์น˜ ๊ฒฝ๋กœ ๋Œ€์‹  ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. `UUID`๋Š” `blkid` ๋ช…๋ น์„ ํ†ตํ•ด ์–ป์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
   - ๊ฐ ๋ผ์ธ์€ ๋งˆ์šดํŠธํ•  ๋””์Šคํฌ์˜ `UUID`, ๋งˆ์šดํŠธ ํฌ์ธํŠธ, ํŒŒ์ผ ์‹œ์Šคํ…œ ์œ ํ˜•, ๋งˆ์šดํŠธ ์˜ต์…˜ ๋“ฑ์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค.
   - ์˜ˆ์‹œ์—์„œ๋Š” NTFS ๋ฐฑ์—… ๋””์Šคํฌ(`RT-8075`)์™€ ์„ ํƒ์ ์ธ NTFS ๋ผ์šฐํ„ฐ ํŒŒํ‹ฐ์…˜(`RT-8075_rt`)์„ ๋งˆ์šดํŠธํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์ œ์‹œ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

์ด ๊ณผ์ •์€ ์›๊ฒฉ ๋ผ์šฐํ„ฐ์˜ ๋ฐฑ์—… ์‹œ์Šคํ…œ์„ ์„ค์ •ํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ ํ•„์ˆ˜์ ์ธ ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค. `fstab` ํŒŒ์ผ ์„ค์ •์€ ๋””์Šคํฌ์™€ ๋ผ์šฐํ„ฐ ์„ค์ •์— ๋”ฐ๋ผ ๋‹ฌ๋ผ์งˆ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ, ์ •ํ™•ํ•œ `UUID`๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
์ด ๋‹จ๊ณ„์—์„œ๋Š” Optware๋ฅผ ์„ค์น˜ํ•˜๊ณ , Rsync๋ฅผ ์›๊ฒฉ ๋ผ์šฐํ„ฐ(RT-8075)์— ์„ค์น˜ํ•˜๋ฉฐ, RSA ํ‚ค๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ์„ค์น˜ํ•˜๋Š” ๊ณผ์ •์„ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค.

1. **Optware ์„ค์น˜**:
   - RT-1080 ์„น์…˜์—์„œ ์ œ๊ณต๋œ ์ง€์นจ์— ๋”ฐ๋ผ Optware๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค. ์ด ๊ณผ์ •์€ Optware๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ Rsync์™€ ๊ฐ™์€ ํ•„์š”ํ•œ ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜๋Š” ๋ฐ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค.

2. **Rsync ์„ค์น˜**:
   - RT-1080 ์„น์…˜์˜ ์ง€์นจ์— ๋”ฐ๋ผ ์›๊ฒฉ ๋ผ์šฐํ„ฐ(RT-8075)์— Rsync๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค. Rsync๋Š” ํŒŒ์ผ ๋™๊ธฐํ™”์™€ ๋ฐฑ์—… ํ”„๋กœ์„ธ์Šค์— ํ•„์ˆ˜์ ์ž…๋‹ˆ๋‹ค.

3. **RSA ํ‚ค ์ƒ์„ฑ ๋ฐ ์„ค์น˜**:
   - PuTTY Key Generator๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๊ฐœ์ธ ๋ฐ ๊ณต๊ฐœ RSA ํ‚ค๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค.
   - ๊ณต๊ฐœ ํ‚ค๋ฅผ RT-8075์˜ GUI (Administration/System) ๋‚ด **SSH Authentication key** ํ•„๋“œ์— ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.
   - ๊ฐœ์ธ ํ‚ค๋ฅผ ์ €์žฅํ•˜๊ณ  RT-1080์˜ **/jffs/dropbear** ํด๋”์— **rsa_id**๋ผ๋Š” ์ด๋ฆ„์œผ๋กœ ๋ณต์‚ฌํ•ฉ๋‹ˆ๋‹ค.

4. **ํ‚ค ํ…Œ์ŠคํŠธ**:
   - ๋น„๋ฐ€๋ฒˆํ˜ธ ์—†์ด RT-8075์— ๋กœ๊ทธ์ธํ•  ์ˆ˜ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด RT-1080 SSH ํ„ฐ๋ฏธ๋„์—์„œ ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค:
     ```ssh -p XXXX -i /jffs/dropbear/rsa_id [email protected]```
   - ๋ชจ๋“  ๊ฒƒ์ด ์ •์ƒ์ ์œผ๋กœ ์ž‘๋™ํ•˜๋ฉด ์›๊ฒฉ ์„œ๋ฒ„์— ๋กœ๊ทธ์ธ๋ฉ๋‹ˆ๋‹ค. ๋กœ๊ทธ์•„์›ƒํ•˜๋ ค๋ฉด `exit`๋ฅผ ์ž…๋ ฅํ•˜๊ณ  ๋ฆฌํ„ดํ•ฉ๋‹ˆ๋‹ค.
   - ๋งŒ์•ฝ ์ž‘๋™ํ•˜์ง€ ์•Š๋Š”๋‹ค๋ฉด, RT-1080 ํ„ฐ๋ฏธ๋„ ์—๋ฎฌ๋ ˆ์ดํ„ฐ์—์„œ ์Šคํฌ๋ฆฝํŠธ์— ์‚ฌ์šฉ๋œ ๊ฐ `rsync` ๋ช…๋ น์–ด๋ฅผ ์ˆ˜๋™์œผ๋กœ ์‹คํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

5. **Rsync ๋ช…๋ น์–ด ํ™•์ธ**:
   - ๋ช…๋ น์–ด์— ๊ตฌ๋ฌธ ์˜ค๋ฅ˜๊ฐ€ ์—†๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
   - ์Šค์™‘ ๊ณต๊ฐ„์ด ํ•„์š”ํ•œ์ง€ ์—ฌ๋ถ€๋ฅผ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

์ด ๋‹จ๊ณ„๋Š” ๋ผ์šฐํ„ฐ ๊ฐ„์˜ ์•ˆ์ „ํ•œ ํŒŒ์ผ ๋™๊ธฐํ™” ๋ฐ ๋ฐฑ์—… ์„ค์ •์„ ์™„๋ฃŒํ•˜๋Š” ๋ฐ ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค. RSA ํ‚ค๋ฅผ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์„ค์ •ํ•˜๊ณ  ํ…Œ์ŠคํŠธํ•˜๋Š” ๊ฒƒ์€ ๋กœ๊ทธ์ธ ํ”„๋กœ์„ธ์Šค๋ฅผ ๋ณด๋‹ค ์•ˆ์ „ํ•˜๊ฒŒ ๋งŒ๋“ค๋ฉฐ, Rsync ๋ช…๋ น์–ด์˜ ์ •ํ™•ํ•œ ๊ตฌ์„ฑ์„ ํ™•์ธํ•˜๋Š” ๊ฒƒ์€ ๋ฐฑ์—… ํ”„๋กœ์„ธ์Šค์˜ ์›ํ™œํ•œ ์ง„ํ–‰์„ ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค.
์ด ๋ช…๋ น์–ด๋Š” `rsync`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ RT-1080์—์„œ RT-8075๋กœ ๋ฐฑ์—… ๋ฐ์ดํ„ฐ๋ฅผ ๋™๊ธฐํ™”ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ๋ช…๋ น์–ด์˜ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ๋ถ„์„ํ•˜๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:

- `rsync`: ๋ฐ์ดํ„ฐ ๋™๊ธฐํ™”๋ฅผ ์œ„ํ•œ ๋ช…๋ น์–ด์ž…๋‹ˆ๋‹ค.
- `-avz`: 
  - `-a`๋Š” ์•„์นด์ด๋ธŒ ๋ชจ๋“œ๋กœ, ์—ฌ๋Ÿฌ ์„œ๋ธŒ๋””๋ ‰ํ† ๋ฆฌ์™€ ํŒŒ์ผ์„ ์žฌ๊ท€์ ์œผ๋กœ ๋ณต์‚ฌํ•˜๋ฉฐ ํŒŒ์ผ ๊ถŒํ•œ, ํƒ€์ž„์Šคํƒฌํ”„, ์‹ฌ๋ณผ๋ฆญ ๋งํฌ ๋“ฑ์„ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค.
  - `-v`๋Š” ์ž์„ธํ•œ(verbose) ์ถœ๋ ฅ์„ ํ™œ์„ฑํ™”ํ•˜์—ฌ ๋™๊ธฐํ™” ์ค‘์ธ ํŒŒ์ผ๊ณผ ํด๋”์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
  - `-z`๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์••์ถ•ํ•˜์—ฌ ๋„คํŠธ์›Œํฌ๋ฅผ ํ†ตํ•ด ์ „์†กํ•ฉ๋‹ˆ๋‹ค.
- `-e 'ssh -p XXXX -i /jffs/dropbear/rsa_id'`: ์ด ๋ถ€๋ถ„์€ `rsync`๊ฐ€ SSH ํ”„๋กœํ† ์ฝœ์„ ์‚ฌ์šฉํ•˜์—ฌ ์›๊ฒฉ ์„œ๋ฒ„์— ์ ‘์†ํ•˜๋„๋ก ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. `XXXX`๋Š” ์‚ฌ์šฉ๋˜๋Š” SSH ํฌํŠธ ๋ฒˆํ˜ธ์ด๋ฉฐ, `/jffs/dropbear/rsa_id`๋Š” ๊ฐœ์ธ ํ‚ค์˜ ๊ฒฝ๋กœ์ž…๋‹ˆ๋‹ค.
- `--log-file=/mnt/RT-1080/Backup-logs/backup1080to8075.log`: ์ด ์˜ต์…˜์€ ๋™๊ธฐํ™” ํ”„๋กœ์„ธ์Šค์˜ ๋กœ๊ทธ๋ฅผ ์ง€์ •๋œ ํŒŒ์ผ์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
- `/mnt/RT-1080/bckp-1080/`: ์†Œ์Šค ๋””๋ ‰ํ† ๋ฆฌ๋กœ, ์—ฌ๊ธฐ์„œ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ณต์‚ฌ๋ฉ๋‹ˆ๋‹ค.
- `[email protected]:/mnt/RT-8075/bckp-1080`: ๋Œ€์ƒ ๋””๋ ‰ํ† ๋ฆฌ๋กœ, ์—ฌ๊ธฐ๋กœ ๋ฐ์ดํ„ฐ๊ฐ€ ๋ณต์‚ฌ๋ฉ๋‹ˆ๋‹ค. `aaaaa`๋Š” ์›๊ฒฉ ๋ผ์šฐํ„ฐ์˜ ์‚ฌ์šฉ์ž ์ด๋ฆ„์ด๋ฉฐ, `ZZZZZ.asuscomm.com`์€ ์›๊ฒฉ ๋ผ์šฐํ„ฐ์˜ ์ฃผ์†Œ์ž…๋‹ˆ๋‹ค.

์ด ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์ „์—, ์‚ฌ์šฉ์ž ์ด๋ฆ„, ์›๊ฒฉ ๋ผ์šฐํ„ฐ ์ฃผ์†Œ, SSH ํฌํŠธ ๋ฒˆํ˜ธ ๋ฐ ๊ฐœ์ธ ํ‚ค ํŒŒ์ผ ๊ฒฝ๋กœ๋ฅผ ์‹ค์ œ ํ™˜๊ฒฝ์— ๋งž๊ฒŒ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ, ์ด ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜์—ฌ ์‹ค์ œ๋กœ ๋ฐ์ดํ„ฐ๊ฐ€ ์›ํ™œํ•˜๊ฒŒ ๋™๊ธฐํ™”๋˜๋Š”์ง€ ํ™•์ธํ•˜๋Š” ๊ฒƒ์ด ์ค‘์š”ํ•ฉ๋‹ˆ๋‹ค.
์ด ๋ช…๋ น์–ด๋Š” `rsync`๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋กœ์ปฌ ๋จธ์‹ (RT-1080)์˜ `/mnt/RT-1080/bckp-1080/` ๋””๋ ‰ํ† ๋ฆฌ์—์„œ ์›๊ฒฉ ๋จธ์‹ (RT-8075)์˜ `/mnt/RT-8075/bckp-1080` ๋””๋ ‰ํ† ๋ฆฌ๋กœ ํŒŒ์ผ์„ ๋™๊ธฐํ™”ํ•ฉ๋‹ˆ๋‹ค. ๋ช…๋ น์–ด์˜ ๊ฐ ๋ถ€๋ถ„์€ ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ธฐ๋Šฅ์„ ํ•ฉ๋‹ˆ๋‹ค:

- `-avz`: ์•„์นด์ด๋ธŒ ๋ชจ๋“œ(`-a`)๋กœ ์‹ฌ๋ณผ๋ฆญ ๋งํฌ, ์žฅ์น˜, ์†์„ฑ, ๊ถŒํ•œ ๋“ฑ์„ ์œ ์ง€ํ•˜๋ฉฐ ํŒŒ์ผ์„ ์ „์†กํ•ฉ๋‹ˆ๋‹ค. ์••์ถ•(`-z`)์„ ์‚ฌ์šฉํ•˜์—ฌ ์ „์†ก ๋ฐ์ดํ„ฐ์˜ ํฌ๊ธฐ๋ฅผ ์ค„์ด๊ณ , ์ž์„ธํ•œ ์ถœ๋ ฅ(`-v`)์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
- `-e 'ssh -p XXXX -i /jffs/dropbear/rsa_id'`: SSH๋ฅผ ํ†ตํ•œ ์•ˆ์ „ํ•œ ์—ฐ๊ฒฐ์„ ์œ„ํ•œ ์˜ต์…˜์ž…๋‹ˆ๋‹ค. `XXXX`๋Š” ์›๊ฒฉ SSH ํฌํŠธ ๋ฒˆํ˜ธ์ด๊ณ , `/jffs/dropbear/rsa_id`๋Š” ๊ฐœ์ธ ํ‚ค์˜ ์œ„์น˜์ž…๋‹ˆ๋‹ค.
- `--log-file=/mnt/RT-1080/Backup-logs/backup1080to8075.log`: ๋™๊ธฐํ™” ๊ณผ์ •์˜ ๋กœ๊ทธ๋ฅผ ์ง€์ •๋œ ํŒŒ์ผ์— ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
- `/mnt/RT-1080/bckp-1080/`: ๋ฐ์ดํ„ฐ์˜ ์ถœ๋ฐœ์ (์†Œ์Šค)์ž…๋‹ˆ๋‹ค.
- `[email protected]:/mnt/RT-8075/bckp-1080`: ๋ฐ์ดํ„ฐ์˜ ๋ชฉ์ ์ง€(๋Œ€์ƒ)์ž…๋‹ˆ๋‹ค. `aaaaa`๋Š” ์›๊ฒฉ ๋ผ์šฐํ„ฐ์˜ ๊ด€๋ฆฌ์ž ID์ž…๋‹ˆ๋‹ค.

๋ฉ”๋ชจ๋ฆฌ ๋ถ€์กฑ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ์šฐ, ์–‘์ชฝ ๋ผ์šฐํ„ฐ(RT-1080๊ณผ RT-8075)์— ์Šค์™‘ ๊ณต๊ฐ„์„ ์ƒ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์Šค์™‘ ํŒŒ์ผ์„ ๋งŒ๋“œ๋Š” ๊ฒƒ์ด ๋” ๊ฐ„๋‹จํ•˜๋ฏ€๋กœ, ์Šค์™‘ ํŒŒํ‹ฐ์…˜ ๋Œ€์‹  ์Šค์™‘ ํŒŒ์ผ์„ ์‚ฌ์šฉํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค.

1GB ์Šค์™‘ ํŒŒ์ผ์„ RT-1080(๋กœ์ปฌ ๋ฐ ๋งˆ์Šคํ„ฐ ๋ผ์šฐํ„ฐ, ๋ฉ”์ธ ํŒŒํ‹ฐ์…˜์— ์ง์ ‘)์— ์ƒ์„ฑํ•˜๋ ค๋ฉด, ๋ผ์šฐํ„ฐ์— ์—ฐ๊ฒฐ๋œ ํ„ฐ๋ฏธ๋„ ์—๋ฎฌ๋ ˆ์ดํ„ฐ์—์„œ ๋‹ค์Œ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•ฉ๋‹ˆ๋‹ค (512MB๋ฅผ ์›ํ•œ๋‹ค๋ฉด 1024๋ฅผ 512๋กœ ๋ฐ”๊ฟ‰๋‹ˆ๋‹ค). ๊ฐ ๋ช…๋ น์–ด๊ฐ€ ์™„๋ฃŒ๋  ๋•Œ๊นŒ์ง€ ๊ธฐ๋‹ค๋ฆฝ๋‹ˆ๋‹ค (์ฒซ ๋ฒˆ์งธ ๋ช…๋ น์–ด๋Š” ๋ช‡ ๋ถ„ ๊ฑธ๋ฆด ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค):
์ด ๊ณผ์ •์—์„œ๋Š” RT-1080 ๋ผ์šฐํ„ฐ์— 1GB ํฌ๊ธฐ์˜ ์Šค์™‘ ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๊ณ , ์ด๋ฅผ ํ™œ์„ฑํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์„ค๋ช…ํ•ฉ๋‹ˆ๋‹ค. ๋™์ผํ•œ ์ ˆ์ฐจ๋ฅผ ์›๊ฒฉ ๋ผ์šฐํ„ฐ(RT-8075)์—์„œ๋„ ์ˆ˜ํ–‰ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

1. **์Šค์™‘ ํŒŒ์ผ ์ƒ์„ฑ**:
   - `dd if=/dev/zero of=/mnt/RT-1080/myswapfile bs=1M count=1024`: 1GB ํฌ๊ธฐ์˜ ์Šค์™‘ ํŒŒ์ผ์„ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ `bs=1M`๋Š” ๋ธ”๋ก ์‚ฌ์ด์ฆˆ๋ฅผ 1MB๋กœ ์„ค์ •ํ•˜๊ณ , `count=1024`๋Š” 1MB ๋ธ”๋ก์„ 1024๊ฐœ ์ƒ์„ฑํ•˜์—ฌ ์ด 1GB์˜ ํŒŒ์ผ์„ ๋งŒ๋“ญ๋‹ˆ๋‹ค.
   - `chmod 600 /mnt/RT-1080/myswapfile`: ์Šค์™‘ ํŒŒ์ผ์— ๋Œ€ํ•œ ๊ถŒํ•œ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ์ด ๋ช…๋ น์€ ํŒŒ์ผ์„ ์˜ค์ง ๋ฃจํŠธ ์‚ฌ์šฉ์ž๋งŒ ์ฝ๊ณ  ์“ธ ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค.

2. **์Šค์™‘ ๊ณต๊ฐ„ ์„ค์ •**:
   - `mkswap /mnt/RT-1080/myswapfile`: ์ƒ์„ฑ๋œ ํŒŒ์ผ์„ ์Šค์™‘ ๊ณต๊ฐ„์œผ๋กœ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค.
   - `swapon /mnt/RT-1080/myswapfile`: ์Šค์™‘ ๊ณต๊ฐ„์„ ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค.

3. **์Šค์™‘ ๊ณต๊ฐ„ ํ™•์ธ**:
   - `free`: ์Šค์™‘ ๊ณต๊ฐ„์ด ์ œ๋Œ€๋กœ ํ™œ์„ฑํ™”๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค. ์ถœ๋ ฅ๋˜๋Š” ๋‚ด์šฉ ์ค‘ "Swap" ์ค„์—์„œ ์ฒซ ๋ฒˆ์งธ ์ˆซ์ž๊ฐ€ "0"์ด ์•„๋‹ˆ๋ฉด ์Šค์™‘์ด ์ •์ƒ์ ์œผ๋กœ ์„ค์ •๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

4. **์›๊ฒฉ ๋ผ์šฐํ„ฐ(RT-8075)์—์„œ ๋™์ผํ•œ ์ ˆ์ฐจ ์ˆ˜ํ–‰**:
   - RT-8075 ๋ผ์šฐํ„ฐ์—์„œ๋„ ๊ฐ™์€ ๋ฐฉ๋ฒ•์œผ๋กœ ์Šค์™‘ ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜๊ณ  ํ™œ์„ฑํ™”ํ•ฉ๋‹ˆ๋‹ค.

5. **rsync ๋ช…๋ น์–ด ํ…Œ์ŠคํŠธ**:
   - ์Šค์™‘ ๊ณต๊ฐ„์ด ๋‘ ๋ผ์šฐํ„ฐ์—์„œ ๋ชจ๋‘ ์„ค์ •๋˜์—ˆ์œผ๋ฉด, ์ด์ „์— ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋˜ `rsync` ๋ช…๋ น์–ด๋ฅผ ๋‹ค์‹œ ํ…Œ์ŠคํŠธํ•ฉ๋‹ˆ๋‹ค.

์ด ๊ณผ์ •์„ ํ†ตํ•ด ๋‘ ๋ผ์šฐํ„ฐ ๊ฐ„์˜ ํŒŒ์ผ ๋™๊ธฐํ™” ๋ฐ ๋ฐฑ์—… ํ”„๋กœ์„ธ์Šค๊ฐ€ ์›ํ™œํ•˜๊ฒŒ ์ง„ํ–‰๋˜๋„๋ก ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฉ”๋ชจ๋ฆฌ ๋ถ€์กฑ ๋ฌธ์ œ๊ฐ€ ์žˆ์—ˆ๋‹ค๋ฉด, ์ด ์Šค์™‘ ๊ณต๊ฐ„ ์„ค์ •์œผ๋กœ ํ•ด๊ฒฐ๋  ๊ฐ€๋Šฅ์„ฑ์ด ๋†’์Šต๋‹ˆ๋‹ค.

Gaston Huot ๋‹˜๊ป˜์„œ ์ œ๊ณตํ•œ ์ด ์ง€์นจ์€ ๋ผ์šฐํ„ฐ ๊ฐ„์˜ ๋ฐฑ์—… ๋ฐ ๋™๊ธฐํ™” ์„ค์ •์„ ์œ„ํ•œ ์ƒ์„ธํ•œ ๊ฐ€์ด๋“œ๋ฅผ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
โš ๏ธ **GitHub.com Fallback** โš ๏ธ