Home Linux script backing up data and copying files to another server
Reply: 0

Linux script backing up data and copying files to another server

user763
1#
user763 Published in May 22, 2018, 4:34 am

I want to write a Cent OS script backing up data and copying files to another server every day.

I want to set up a script that would dump the DB and then, once that is done, copy the dump file to another server.

As I understand, I need to set up a file that would list those commands and then add it into crontab.

Where I'm stuck is how to write that file, as I'm not familiar with Linux server commands. Would it be something like that below? What could I fix?

#!/bin/sh
backupscript -r ~/path/to/db ~/path/to/backup
sshpass -f "/path/to/passwordfile" scp -r /some/local/path user@example.com:/some/remote/path

But how will scp know when to run after backupscript is over?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.392073 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO