From 79a139a0fc140dc61f711a71a198214403121317 Mon Sep 17 00:00:00 2001 From: booboy Date: Sat, 2 Feb 2019 04:28:04 -0600 Subject: [PATCH] added examples of how you can automate downloading pastes with the command line binary and some systemd service/timer file pairs --- .../pastebinner_download_raw_json_paste.service | 13 +++++++++++++ .../pastebinner_download_raw_json_paste.timer | 10 ++++++++++ .../systemd/pastebinner_download_raw_paste.service | 13 +++++++++++++ .../systemd/pastebinner_download_raw_paste.timer | 10 ++++++++++ 4 files changed, 46 insertions(+) create mode 100644 lib/examples/systemd/pastebinner_download_raw_json_paste.service create mode 100644 lib/examples/systemd/pastebinner_download_raw_json_paste.timer create mode 100644 lib/examples/systemd/pastebinner_download_raw_paste.service create mode 100644 lib/examples/systemd/pastebinner_download_raw_paste.timer diff --git a/lib/examples/systemd/pastebinner_download_raw_json_paste.service b/lib/examples/systemd/pastebinner_download_raw_json_paste.service new file mode 100644 index 0000000..1d92bf3 --- /dev/null +++ b/lib/examples/systemd/pastebinner_download_raw_json_paste.service @@ -0,0 +1,13 @@ +[Unit] +Description=Pastebin download newest json paste data + +[Service] +# user that is running pastebinner +User=booboy +# change WorkingDirectory to directory where pastebinner bin dir is located +WorkingDirectory=/home/booboy/bin/bpmcdevitt_gitlab/pastebinner/bin +# change ExecStart to point to our pastebinner binary and pass in the --json option +ExecStart=/usr/bin/ruby /home/booboy/bin/bpmcdevitt_gitlab/pastebinner/bin/pastebinner --json + +[Install] +WantedBy=multi-user.target diff --git a/lib/examples/systemd/pastebinner_download_raw_json_paste.timer b/lib/examples/systemd/pastebinner_download_raw_json_paste.timer new file mode 100644 index 0000000..e46f4bb --- /dev/null +++ b/lib/examples/systemd/pastebinner_download_raw_json_paste.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Download new pastebin raw paste data every 1 minute. + +[Timer] +OnBootSec=5min +OnCalendar=*:0/1 + +[Install] +WantedBy=timers.target + diff --git a/lib/examples/systemd/pastebinner_download_raw_paste.service b/lib/examples/systemd/pastebinner_download_raw_paste.service new file mode 100644 index 0000000..c22152f --- /dev/null +++ b/lib/examples/systemd/pastebinner_download_raw_paste.service @@ -0,0 +1,13 @@ +[Unit] +Description=Pastebin download newest raw paste data + +[Service] +# user that is running pastebinner +User=booboy +# change WorkingDirectory to directory where pastebinner bin dir is located +WorkingDirectory=/home/booboy/bin/bpmcdevitt_gitlab/pastebinner/bin +# change ExecStart to point to our pastebinner binary and pass in the --download option +ExecStart=/usr/bin/ruby /home/booboy/bin/bpmcdevitt_gitlab/pastebinner/bin/pastebinner --download + +[Install] +WantedBy=multi-user.target diff --git a/lib/examples/systemd/pastebinner_download_raw_paste.timer b/lib/examples/systemd/pastebinner_download_raw_paste.timer new file mode 100644 index 0000000..e46f4bb --- /dev/null +++ b/lib/examples/systemd/pastebinner_download_raw_paste.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Download new pastebin raw paste data every 1 minute. + +[Timer] +OnBootSec=5min +OnCalendar=*:0/1 + +[Install] +WantedBy=timers.target +