From fe0ed0a4a8b8f555fcc105602a43d3355d67c3db Mon Sep 17 00:00:00 2001 From: SinTan1729 Date: Mon, 31 Jul 2023 15:08:15 -0500 Subject: [PATCH] docs: Add information about systemd timers in README --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4f72376..b036563 100644 --- a/README.md +++ b/README.md @@ -2,16 +2,49 @@ This repo will allow one to build [ReVanced](https://github.com/revanced/) apps automatically and post it to a telegram channel to access and possibly share the builds with friends. It uses [Gotify](https://gotify.net), [ntfy.sh](https://ntfy.sh) or [telegram.sh](https://github.com/fabianonline/telegram.sh) to send messages and [telegram-upload](https://github.com/Nekmo/telegram-upload) to upload files (optionally, disabled out by default). Make sure that `Java >=17` is installed and selected as default. ## How to use -Just run `./build_revanced (force/clean/experimental/checkonly/buildonly)`. Might be a good idea to set it up to run periodically using cron. I currently use the following in a user crontab to run it everyday at 6 AM: -``` -0 6 * * * -``` +Just run `./build_revanced (force/clean/experimental/checkonly/buildonly)`. Might be a good idea to set it up to run periodically. There are a few ways of doing it. +1. Just drop it inside `/etc/cron.daily/`. +1. To make it run at a specific time (6AM in the example) using `cron`, put this in your `crontab`: + ```crontab + 0 6 * * * + ``` +1. The exact same thing as in 2 can be achieved using `systemd` timers instead. Create the following files. + ```toml + /etc/systemd/system/revanced-builder.service + --------------------------------------------- + [Unit] + Description=Automatically build new builds of ReVanced + Wants=network-online.target + After=network-online.target + + [Service] + Type=oneshot + User= + Group= + ExecStart=_JAVA_OPTIONS='-Xmx512m' + ``` + ```toml + /etc/systemd/system/revanced-builder.timer + ------------------------------------------- + [Unit] + Description=Automatically build new builds of ReVanced + + [Timer] + OnCalendar=*-*-* 6:00:00 + + [Install] + WantedBy=timers.target + ``` + and then enable the timer using + ```bash + sudo systemctl enable --now revanced-builder.timer + ``` ## Notes - The following programs are needed to run this script. Make sure that you have them in your `$PATH`. - ``` - htmlq jq wget java curl - ``` + ``` + htmlq jq wget java curl + ``` - To enable build for a particular apk, copy the `build_settings` file to your working directory and modify it to suit your needs. - The script will download the **automatically selected compatible version** (using compatibility of patches as listed [here](https://github.com/revanced/revanced-patches#list-of-available-patches)) of Youtube on APKPure, **NOT** latest official version on Google Play. - Under **NO CIRCUMSTANCES** any APKs will be uploaded to this repository to avoid DMCA.