• 3 Posts
  • 142 Comments
Joined 3 months ago
cake
Cake day: March 31st, 2024

help-circle









  • Here is my template

    sudo cat > /etc/systemd/user/rsync-backup.service <<EOF
    [Unit]
    Description=do rsync backups with some conditions
    # After=network-online.target
    
    [Service]
    Type=oneshot
    # require a power connection (optional)
    # ExecStartPre=sh -c '[ $(cat /sys/class/power_supply/AC/online) = 1 ]'
    
    # require battery over 40%
    # ExecStartPre=sh -c '[ $(cat /sys/class/power_supply/BAT0/capacity) -ge 40 ]'
    
    # require the connected network to NOT be "metered"
    # ExecStartPre=sh -c '! $(nmcli -t -f GENERAL.METERED dev show | grep -q 'yes')'
    
    ExecStart=/home/user/.local/bin/rsync-backup
    # you might add everything you need
    # ExecStart=/path/to/something/else
    
    # delete old logs (disabled for testing)
    # ExecStartPost=rm -f /var/log/rsync-backups.log
    # log the updates
    # ExecStartPost=sh -c 'echo "Last backup: $(date)" > /var/log/rsync-backup.log'
    # write errors to log
    StandardError=file:/var/log/rsync-backups.log
    
    # GUI message
    #ExecStartPost=/usr/bin/notify-send -t 0 -a "Backup" "rsync backup finished." "$(output of some command if you want infos about the backup)"
    
    # run with low priority, when idling
    # Nice=15
    IOSchedulingClass=idle
    
    # when conditions were not met, try again after 15 minutes
    # Restart=on-failure
    # RestartSec=900
    
    [Install]
    WantedBy=multi-user.target
    EOF
    

    Timer file:

    sudo cat > /etc/systemd/user/rsync-backup.timer <<EOF
    [Unit]
    Description=do rsync backups with some conditions
    
    [Timer]
    OnCalendar=daily
    Persistent=true
    EOF
    

    (I think the unit is needed)

    That is a slightly modified variant of my automatic rpm-ostree system updates which took an hour or so with the help of ChatGPT and a lot of testing around.

    Systemd services are lit.

    If you add a “repeat when conditions are not met” you need another timer to start it. Like 2 loops, one big loop to start the process, and one small loop to keep trying until conditions are met. I do that with my system updates to prevent them being done

    • with low battery (or even using an AC requirement)
    • over a metered network
    • when the system is busy

  • I think their concept is just as flawed as “dash to dock”. Desperately trying to “not be Windows” (while mimicking mac lol)…

    You have a huge top bar that is mainly unused space. You have no hitbox at the top right edge, because of the bad GNOME decorations (also in Firefox) and because of that stupid top bar.

    Then having a dock with empty space around it, where you could easily fit clock, quicksettings and menu, why??

    Dash to panel fixes most, just not the bad hitboxes to the top edge. And luckily it is very actively maintained.

    Ubuntu meanwhile keeps that useless top bar and also places a bar at the edge. This is good for regular screens. But it is annoying when tiling in half.

    And they dont fix it, as they still keep the silly top bar.

    And the main issue is their theming, which breaks apps.