Blocklist-Update.sh is a script that I wrote to manage blocklists from bluetack etc to be used in conjunction with Transmission torrent downloader in Linux/MacOS. The script can be taylored to work with Qbittorrent as well, but the placement of the blocklists means you'd have to redirect the blocklist to go somewhere locally manageable as Transmission uses its own blocklist directory in .config. I believe there are about 10 lists there now. It works well for my needs. It can be ran weekly using crontab in standard user profile. To download: blocklist-update.sh To download the others: Github
In the spirit of the bash scripting tutorials I am working on, this
is one tool that can be quite useful when automating certain tasks.
Systemd utilizes files in detail describing each unit. These unit
files give the name and path of the unit to be ran and act more like
.desktop files in way of their format. Systemd can not run a unit
without a file such as this. Systemd timers follow the system clock
to perform an action. To list timers on a system, running the
command systemctl list-timers (--all) will respectively display each
timer active on a system with the all flag showing inactive ones too.
To create your own timers/services you can use the following format:
[UNIT]
Description=”Aptly names or describes what the unit/script will do”
CONFLICTS=”Makes sure the timer stops when the service starts”
[SERVICE]
Type=”Simple usually works for a service unless you just want it to
run once then oneshot works”
ExecStart= path to file or service to be ran
User=”It’s always good practice to put in which user is
leveraging this tool.”
[TIMER]
OnCalendar=”Time and date unit is expected to run”
Persistent=TRUE/FALSE Tells the unit to run even if time was missed
or not. Takes boolean arguments.
[INSTALL]
WantedBy=”The target user this is effecting.”
Depending upon your needs, the above can handle running most scripts.
You will need to add suspend as a target though in WantedBy if you
are running the script after resume. Scrolling the man pages for
systemd might help, but those are sometimes dim and bleak. Finding
answers for your specific questions online is one of the best ways to
mastering anything involving tech. I will link certain resources at
the bottom.
Man Page for systemd.timer:
https://www.freedesktop.org/software/systemd/man/systemd.timer.html
Links to some useful examples:
https://unix.stackexchange.com/questions/124212/writing-a-systemd-service-to-be-executed-at-resume
Comments
Post a Comment