Просто укажите частичный каталог, как рекомендует rsync man pages:
--partial-dir=.rsync-partial
На самом деле существует встроенная возможность сделать это с помощью опции --partial-dir
, которая имеет несколько преимуществ перед альтернативами --partial
и --append-verify
/--append
.
--partial-dir=DIR
A better way to keep partial files than the --partial option is
to specify a DIR that will be used to hold the partial data
(instead of writing it out to the destination file). On the
next transfer, rsync will use a file found in this dir as data
to speed up the resumption of the transfer and then delete it
after it has served its purpose.
Note that if --whole-file is specified (or implied), any par-
tial-dir file that is found for a file that is being updated
will simply be removed (since rsync is sending files without
using rsync's delta-transfer algorithm).
Rsync will create the DIR if it is missing (just the last dir --
not the whole path). This makes it easy to use a relative path
(such as "--partial-dir=.rsync-partial") to have rsync create
the partial-directory in the destination file's directory when
needed, and then remove it again when the partial file is
deleted.
If the partial-dir value is not an absolute path, rsync will add
an exclude rule at the end of all your existing excludes. This
will prevent the sending of any partial-dir files that may exist
on the sending side, and will also prevent the untimely deletion
of partial-dir items on the receiving side. An example: the
above --partial-dir option would add the equivalent of "-f '-p
.rsync-partial/'" at the end of any other filter rules.
По умолчанию rsync использует случайное имя временного файла, которое удаляется при неудачной передаче. Как упоминалось, используя --partial
, вы можете заставить rsync сохранить неполный файл как если бы он был успешно передан, чтобы впоследствии можно было добавить к нему файл с помощью опций --append-verify
/--append
. Однако есть несколько причин, по которым это неоптимально.
Ваши файлы резервного копирования могут быть неполными, и без проверки удаленного файла, который должен быть все еще неизменен, нет способа узнать это.
Если вы пытаетесь использовать --backup
и --backup-dir
, вы только что добавили в историю версий новую версию этого файла, который до этого даже не выходил.
Однако если мы используем --partial-dir
, rsync сохранит временный частичный файл, и возобновит загрузку, используя этот частичный файл при следующем запуске, и мы не будем страдать от вышеописанных проблем.
Ошибка «команда не найдена» означает, что у вас не установлена команда.
Использование страницы Debian «поиск в содержимом пакетов» вызывает:
...
/sbin/route net-tools [not powerpc]
....
Таким образом, (если ваш ЦП не PowerPC ), вам следует установить пакет net-tools
.
/sbin
отсутствует в вашем PATH, используйте:
$ /sbin/route
или:
$ export PATH=$PATH:/sbin
$ route
Вы можете добавить указанную выше команду в свой.bashrc
:
echo "export PATH=$PATH:/sbin" >>.bashrc
source.bashrc
net-tools
предоставляет команду route
. Чтение вывода команды route
не требует специальных прав.