V
V
Vyacheslav Kordienko2017-04-11 10:25:08
linux
Vyacheslav Kordienko, 2017-04-11 10:25:08

bash. How to send files over SSH from res-ta variable?

Hi all!
I'm just getting started with making my own bash scripts.
Tell me how to best implement the task of transferring the found files by creation date to another server via ssh
Local backup daily, source files with a unique name backup1-DD.MM.YY.tar.gz
In this form, it occurred to me.

#!/bin/sh

### поиск ###
FFILES=$(find /backup -type f -mtime -1)

### создание временной папки и копирование туда найденных файлов###

### передача ###
rsync -avz -e "ssh -p 2222" $temp_dir  [email protected]:/home/backup/

### удаление временной папки ###

I suppose it's better to do without creating a temporary folder, and send files en masse?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor Taran, 2017-04-11
@AmonTobin

as an option, you can transfer via wput is put from the repo and you can limit the transfer rate.
how else the variant is banal
find has -exec
like {} array output, the
only thing you need to look at is special characters, but it seems something like this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question