Archlinux: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 63: | Line 63: | ||
Update system | Update system | ||
pacman -Syu | pacman -Syu | ||
Create cron script. | |||
vim /root/bin/cron-daily-script | |||
# Scheduled script | |||
pacman -Syu | |||
Make script executable | |||
chmod 755 /root/bin/cron-daily-script | |||
Create service running script. | |||
vim /usr/lib/systemd/system/cron-daily-script.service | |||
[Unit] | |||
Description=cron-daily-script | |||
[Service] | |||
Type=simple | |||
ExecStart=/root/bin/cron-daily-script | |||
Create cronjob | |||
vim /usr/lib/systemd/system/cron-daily-script.timer | |||
[Unit] | |||
Description=Runs cron-daily-script evry day. | |||
[Timer] | |||
# Time to wait after booting before we run first time | |||
OnBootSec=10min | |||
# Time between running each consecutive time | |||
OnUnitActiveSec=1d | |||
Unit=cron-daily-script.service | |||
[Install] | |||
WantedBy=multi-user.target | |||
Enable cron job | |||
systemctl start cron-daily-script.timer | |||
systemctl enable cron-daily-script.timer | |||
List jobs. | |||
systemctl list-timers --all |
Revision as of 06:41, 10 April 2016
Create disks
gdisk /dev/sda Number Start (sector) End (sector) Size Code Name 1 2048 4095 1024.0 KiB EF02 BIOS boot partition 2 4096 62914526 30.0 GiB 8300 Linux filesystem
mount /dev/sda2 /mnt
Install some groups
pacstrap /mnt/ base xfce4 xorg
genfstab -p /mnt >> /mnt/etc/fstab
arch-chroot /mnt
echo archlinux.halfface.se > /etc/hostname
ln -s /usr/share/zoneinfo/Europe/Stockholm /etc/localtime
Install some apps
pacman --noconfirm -S grub vim openssh sudo rsync mlocate
vim /etc/locale.gen locale-gen
vim /etc/locale.conf LANG="en_US.UTF-8"
vim /etc/vconsole.conf KEYMAP="se-nodeadkeys" FONT="eurlatgr"
Setup systemd network
/etc/systemd/network/wired.network [Match] Name=enp1s0 [Network] DHCP=ipv4 UseHostname=false
Start Network
systemctl enable systemd-networkd.service systemctl start systemd-networkd.service systemctl enable systemd-resolved.service systemctl start systemd-resolved.service ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
Start sshd
systemctl enable sshd.service systemctl start sshd.service
Create initrd
mkinitcpio -p linux
passwd
Setup grub
grub-install --target=i386-pc /dev/sda grub-mkconfig -o /boot/grub/grub.cfg
reboot
Update system
pacman -Syu
Create cron script.
vim /root/bin/cron-daily-script # Scheduled script pacman -Syu
Make script executable
chmod 755 /root/bin/cron-daily-script
Create service running script.
vim /usr/lib/systemd/system/cron-daily-script.service [Unit] Description=cron-daily-script [Service] Type=simple ExecStart=/root/bin/cron-daily-script
Create cronjob
vim /usr/lib/systemd/system/cron-daily-script.timer [Unit] Description=Runs cron-daily-script evry day. [Timer] # Time to wait after booting before we run first time OnBootSec=10min # Time between running each consecutive time OnUnitActiveSec=1d Unit=cron-daily-script.service [Install] WantedBy=multi-user.target
Enable cron job
systemctl start cron-daily-script.timer systemctl enable cron-daily-script.timer
List jobs.
systemctl list-timers --all