This commit is contained in:
parent
f17345dae8
commit
575e940dde
@ -8,5 +8,11 @@ indent_style = space
|
|||||||
indent_size = 4
|
indent_size = 4
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
||||||
|
[{*.service,*.timer}]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
insert_final_newline = false
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
17
README.md
17
README.md
@ -20,11 +20,22 @@ git clone https://devops.lty.name/luo/backupd.git /opt/backupd
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
**Ownership**
|
>
|
||||||
|
> **Note**
|
||||||
|
>
|
||||||
|
> You have to complete ALL FOLLOWING STEPS to make the script work properly.
|
||||||
|
>
|
||||||
|
|
||||||
Don't forget to change the ownership of the directory:
|
**Permissions**
|
||||||
|
|
||||||
|
Don't forget to change the ownership and permissions of the files:
|
||||||
```bash
|
```bash
|
||||||
chown -R root:root /opt/backupd
|
chown -R root:root /opt/backupd
|
||||||
|
cd /opt/backupd
|
||||||
|
for file in *.example; do
|
||||||
|
mv "$file" "${file%.example}"
|
||||||
|
done
|
||||||
|
chmod 600 rclone.conf passwd
|
||||||
```
|
```
|
||||||
|
|
||||||
**Rclone**
|
**Rclone**
|
||||||
@ -65,7 +76,7 @@ If you wish to run the script as scheduled tasks, copy the fillowing files to `/
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
cp /opt/backupd/backupd.service /etc/systemd/system/
|
cp /opt/backupd/backupd.service /etc/systemd/system/
|
||||||
cp /opt/backupd/backupd.timer /etc/systemd/system/
|
cp /opt/backupd/backupd.timer /etc/systemd/system/
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, enable and start the timer:
|
Then, enable and start the timer:
|
||||||
|
7
backupd.service
Normal file
7
backupd.service
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=A simple backup script
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/opt/backupd/backupd
|
9
backupd.timer
Normal file
9
backupd.timer
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Run backupd daily
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnCalendar=*-*-* 09:00:00 UTC
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
Loading…
x
Reference in New Issue
Block a user