-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backup script for kernel snapshots to s3
- Loading branch information
1 parent
e888c51
commit 6debb31
Showing
7 changed files
with
44 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=Mixin Kernel Backup Service | ||
After=network.target | ||
|
||
[Service] | ||
User=one | ||
Type=simple | ||
ExecStart=/user/bin/mnm run '/home/one/bin/snapshots.sh' | ||
Restart=on-failure | ||
LimitNOFILE=65536 | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[Unit] | ||
Description=Mixin Kernel Backup Timer | ||
|
||
[Timer] | ||
Unit=mixin-backup.service | ||
OnCalendar=*-*-* 00:00:00 | ||
Persistent=True | ||
RandomizedDelaySec=300 | ||
|
||
[Install] | ||
WantedBy=timers.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
|
||
sudo systemctl stop mixin-archive || exit 1 | ||
|
||
tar cf - -C /mnt/archive/mixin snapshots | s3cmd put - s3://mixin/snapshots/kernel.tar.new || exit 1 | ||
|
||
s3cmd mv s3://mixin/snapshots/kernel.tar.new s3://mixin/snapshots/kernel.tar || exit 1 | ||
|
||
s3cmd setacl s3://mixin/snapshots/kernel.tar --acl-public || exit 1 | ||
|
||
s3cmd la --recursive || exit 1 | ||
|
||
sudo systemctl restart mixin-archive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters