arch: pacman automatic download
This little post explains how to enable download for packages of pacman. It uses a systemd service.
Create the download service (note the option -w for just downloading the packages):
[code language="bash"]
$ sudo vim /etc/systemd/system/pacman-downloader.service
[Unit]
Description=Automatic Update
After=network-online.target
[Service]
Type=simple
ExecStart=/usr/bin/pacman -Syuwq --noconfirm
TimeoutStopSec=180
KillMode=process
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
[/code]
Create a timer service to launch the downloader:
[code language="bash"]
$ sudo vim /etc/systemd/system/pacman-downloader.timer
[Unit]
Description=Automatic Update when booted up after 5 minutes then check the system for updates every 60 minutes
[Timer]
OnBootSec=5min
OnUnitActiveSec=60min
Unit=pacman-downloader.service
[Install]
WantedBy=multi-user.target
[/code]
Enable and start the service using systemctl.
Source-link: www.techrapid.co.uk