From 41ff6887013a36f6bcf1bffc51ebfcb2a22acba8 Mon Sep 17 00:00:00 2001 From: 3err0 Date: Wed, 15 Feb 2023 06:36:57 +0800 Subject: [PATCH] backup script --- rsync_backup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 rsync_backup.sh diff --git a/rsync_backup.sh b/rsync_backup.sh new file mode 100644 index 0000000..2698430 --- /dev/null +++ b/rsync_backup.sh @@ -0,0 +1,12 @@ +#!/bin/bash +PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin + +password_file='/etc/rsyncd.pwd' +exclude_file='/etc/rsyncd.exclude' + +user='user' +ip='ip' +source='/opt /var/www' +destination='data/' + +rsync -a --exclude-from=$exclude_file --password-file=$password_file $source $user@$ip::$destination \ No newline at end of file