Update home scripts.
This commit is contained in:
parent
0b722b116b
commit
3abb50cfc2
|
@ -6,9 +6,17 @@
|
||||||
description = "Home system backup.";
|
description = "Home system backup.";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "/root/app/bin/home/backup";
|
ExecStart = "/root/app/bin/home/Backup";
|
||||||
};
|
};
|
||||||
wantedBy = [ "multi-user.target" ];
|
path = with pkgs; [
|
||||||
|
bashInteractive
|
||||||
|
curl
|
||||||
|
gnutar
|
||||||
|
gzip
|
||||||
|
gawk
|
||||||
|
pv
|
||||||
|
];
|
||||||
|
# wantedBy = [ "multi-user.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.timers.backup = {
|
systemd.timers.backup = {
|
||||||
|
|
|
@ -6,9 +6,13 @@
|
||||||
description = "Nextcloud worker.";
|
description = "Nextcloud worker.";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "/root/app/bin/home/nextcloud";
|
ExecStart = "/root/app/bin/home/Nextcloud";
|
||||||
};
|
};
|
||||||
wantedBy = [ "multi-user.target" ];
|
path = with pkgs; [
|
||||||
|
bashInteractive
|
||||||
|
docker
|
||||||
|
];
|
||||||
|
# wantedBy = [ "multi-user.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.timers.nextcloud = {
|
systemd.timers.nextcloud = {
|
||||||
|
|
|
@ -6,9 +6,13 @@
|
||||||
description = "Process uploaded photos.";
|
description = "Process uploaded photos.";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "/root/app/bin/home/photos_process";
|
ExecStart = "/root/app/bin/home/PhotosProcess";
|
||||||
};
|
};
|
||||||
wantedBy = [ "multi-user.target" ];
|
path = with pkgs; [
|
||||||
|
bashInteractive
|
||||||
|
docker
|
||||||
|
];
|
||||||
|
# wantedBy = [ "multi-user.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.timers.photos_process = {
|
systemd.timers.photos_process = {
|
||||||
|
|
|
@ -6,9 +6,13 @@
|
||||||
description = "Sync music from Yandex.Music.";
|
description = "Sync music from Yandex.Music.";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "/root/app/bin/home/yandex_music";
|
ExecStart = "/root/app/bin/home/YandexMusic";
|
||||||
};
|
};
|
||||||
wantedBy = [ "multi-user.target" ];
|
path = with pkgs; [
|
||||||
|
bashInteractive
|
||||||
|
docker
|
||||||
|
];
|
||||||
|
# wantedBy = [ "multi-user.target" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.timers.yandex_music = {
|
systemd.timers.yandex_music = {
|
||||||
|
|
8
app/bin/home/Nextcloud
Executable file
8
app/bin/home/Nextcloud
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Source modules.
|
||||||
|
for file in /root/.config/bash/module/*.sh; do
|
||||||
|
source "${file}"
|
||||||
|
done
|
||||||
|
|
||||||
|
docker exec -u 33 cloud php -f /var/www/html/cron.php || notify 'Nextcloud : Failed to run cron.'
|
|
@ -3,4 +3,4 @@
|
||||||
in="/storage/hot/docker/cloud/data/data/cakee/files/media/photo/"
|
in="/storage/hot/docker/cloud/data/data/cakee/files/media/photo/"
|
||||||
out="/storage/cold_1/backup/tmp/photo/"
|
out="/storage/cold_1/backup/tmp/photo/"
|
||||||
|
|
||||||
/usr/bin/docker run --rm -v "${in}":/in -v "${out}":/out voronind.com/photoprocess:latest
|
docker run --rm -v "${in}":/in -v "${out}":/out voronind.com/photoprocess:latest
|
5
app/bin/home/YandexMusic
Executable file
5
app/bin/home/YandexMusic
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
music="/storage/hot/media/music/"
|
||||||
|
|
||||||
|
docker run --rm -v "${music}":/music voronind.com/yamusic:latest
|
|
@ -1,16 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
shopt -s globstar
|
|
||||||
shopt -s dotglob
|
|
||||||
|
|
||||||
notify()
|
|
||||||
{
|
|
||||||
curl -X POST -H 'Content-Type: Application/json' -d "{\"chat_id\":\"155897358\",\"text\":\"$1\"}" https://api.telegram.org/bot2046849441:AAHQpjRK4xpL8tEUyN4JTSDUUze4J0wSIy4/sendMessage &> /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
notify_silent()
|
|
||||||
{
|
|
||||||
curl -X POST -H 'Content-Type: Application/json' -d "{\"chat_id\":\"155897358\",\"text\":\"$1\",\"disable_notification\":\"true\"}" https://api.telegram.org/bot2046849441:AAHQpjRK4xpL8tEUyN4JTSDUUze4J0wSIy4/sendMessage &> /dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
docker exec -u 33 cloud php -f /var/www/html/cron.php || notify 'nextcloud : failed to run cron'
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
music="/storage/hot/media/music/"
|
|
||||||
|
|
||||||
/usr/bin/docker run --rm -v "${music}":/music voronind.com/yamusic:latest
|
|
Reference in a new issue