S
S
Sergey Goryachev2015-12-27 23:18:28
linux
Sergey Goryachev, 2015-12-27 23:18:28

How to make automatic transfer of files from one directory to another on CentOS?

Good day!
I installed the VestaCP control panel on the CentOS server and got upset.
She does not know how to save backups via WebDAV, only via FTP.
But I have a paid POISON, there is 1TB, which was planned to be used just for backup.
Mounting the Disk and making it in Startup was no problem.
But, I would also like to make backups from the /home/backup/ folder move to /mnt/yandex.disk/backup/ Tell me
, how to make it do it correctly using the crown?
UPD: Or maybe you can fix the path right away? So that copies fall immediately on the POISON?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Konstantin Kozhin, 2015-12-27
@kkzhn

For example, you can write a copy script and run it at the right time.

#!/bin/bash

DIRECTORY=/mnt/yandex.disk/backup

if [ -d "$DIRECTORY" ]; then
    cp /home/backup/архив_с_резервной_копией.tar.gz $DIRECTORY
fi

You need to check the existence of the directory in case WebDAV suddenly "falls off". As an else condition, you can, for example, send a letter to the admin's address.
Cron will have something like:
Runs the script every day at 3:00.

V
vanoc, 2015-12-29
@Zoro

Options:
1. Mount
mount --bind /home/backup /mnt/yandex.disk/backup
2. Make a symbolic link
ln -s /home/backup /mnt/yandex.disk/backup
3. Monitor with the same find krone
find /home/backup -name=* -exec cp -r --parents {} /home/yandex.disk/backup ;\
4. It seems that Yandex disk can specify which directory to synchronize. Maybe I'm wrong.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question