LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Making a backup and send it to another server. (https://www.linuxquestions.org/questions/linux-newbie-8/making-a-backup-and-send-it-to-another-server-4175545659/)

adumith 06-17-2015 03:42 PM

Making a backup and send it to another server.
 
Hello everyone;

I´m makign a cron job wich this
Code:

rsync -ravz files_to_backup user@IP:folder_target
; but I´m not sure if this script is a good way.

I wonder to know wich one is your opinion about this.

Best regards;

ADumith

TenTenths 06-17-2015 03:59 PM

That's pretty much what I used to use for remote backups, so you're on the right track.

adumith 06-17-2015 04:06 PM

Quote:

Originally Posted by TenTenths (Post 5378883)
That's pretty much what I used to use for remote backups, so you're on the right track.

Thanks a lot for your reply TenTenths; but I have a doubt how I can specify when I have several objects and folders?

Thanks again.

TenTenths 06-17-2015 04:13 PM

I'd write a simple bash script to do it then if you've multiple items, then you can run the script and it'll do your rsyncs in order. Then run your script as the cron job.

adumith 06-17-2015 04:16 PM

Quote:

Originally Posted by TenTenths (Post 5378892)
I'd write a simple bash script to do it then if you've multiple items, then you can run the script and it'll do your rsyncs in order. Then run your script as the cron job.

Could you share this sript with me?

TenTenths 06-17-2015 04:23 PM

Code:

#!/bin/bash

/usr/bin/rsync -ravz files_to_backup user@IP:folder_target
/usr/bin/rsync -ravz files_to_backup_2 user@IP:folder_target_2

etc. etc. etc. Obviously replace /usr/bin/rsync with the full path to rsync for your distro.

adumith 06-17-2015 04:37 PM

Quote:

Originally Posted by TenTenths (Post 5378901)
Code:

#!/bin/bash

/usr/bin/rsync -ravz files_to_backup user@IP:folder_target
/usr/bin/rsync -ravz files_to_backup_2 user@IP:folder_target_2

etc. etc. etc. Obviously replace /usr/bin/rsync with the full path to rsync for your distro.

Ok, I got it!

Thanks a lot for you reply.

One more question: This script work for incremental backup or just replace the old one files?

Thanks again...

TenTenths 06-17-2015 04:43 PM

Just replaces

adumith 06-17-2015 05:22 PM

Great, thanks a lot for your help.

Have a nice day.....


All times are GMT -5. The time now is 03:10 PM.