Skip Navigation

Posts
37
Comments
52
Joined
2 yr. ago

  • It seems that this doesn't work as expected. Please see my new post from today. I have found also the following issue https://github.com/systemd/systemd/issues/3107. According to this, a monotonic timer doesn't survive a reboot or power off. Please correct me, if I'm wrong.

    If I understand this correctly, only a onCalendar type can be used here. That's a little bit annoying, but as of yet, I haven't found a way around this.

  • Sorry, i have to ask again. I actually thought I had solved the problem. However, today I discovered that the jobs are overdue and have not been started for several days. When I display the timers with systemctl --user list-timers, I see that the NEXT column is empty::

     
        
    NEXT LEFT LAST                         PASSED UNIT                  ACTIVATES              
    -       - Sun 2026-02-01 20:01:48 CET       - backup.timer  backup.service
    
    
      

    Since there is no NEXT date, the timer/service will probably not be restarted. The timer unit looks like this:

     
        
    [Unit]
    Description="Backup to remote"
    
    [Timer]
    OnUnitActiveSec=3d
    Persistent=true
    
    [Install]
    WantedBy=default.target
    
      

    As you can see, I am well over the 3 days. When I call systemctl --user status backup.timer, I get:

     
        
    ● backup.timer - "Backup to remote"
         Loaded: loaded (/home/username/.config/systemd/user/backup.timer; enabled; preset: enabled)
        Drop-In: /home/username/.config/systemd/user/backup.timer.d
         Active: active (elapsed) since Fri 2026-02-13 16:53:31 CET; 7min ago
     Invocation: 95ae3860c50a454b98078fc2ce3eb3c5
        Trigger: n/a
       Triggers: ● backup.service
    
    
      

    To me, this looks perfectly "normal." The only thing that puzzles me is the Active line. Why is the current date (Fri 2026-02-13 16:53:31 CET) set there and not the date on which the job last ran (Sun 2026-02-01 20:01:48 CET)? The NEXT column fills up again when I start systemctl --user restart backup.service. The job is then executed immediately and the column is filled. However, after rebooting the laptop, the column is empty again and the job is no longer started at the given intervals.

  • Ahh even more possibility's. Many thx.

  • OK. I think 7 day was a slightly misleading schedule :-) My bad. But yes, you are right, for 7 days, this will work fine. But i think OnUnitActiveSec=7d is more flexible, when i change this to 12 days, 9 days and so on... I should learn to be more precise in my questions. Sorry.

  • Shifting the day of the week is totally fine, since i only care about days between the job executions. Many thx, then i try my luck with this.

  • Linux Questions @lemmy.zip

    Systemd Timer units

  • KDE @lemmy.kde.social

    Cant use keyboard shortcuts with multiple tabs open in kwrite

  • Pixelfed @lemmy.world

    Pixelfed Android App

  • I have one additional question. Sorry. According to the wiki I should use grub-mkconfig -o /boot/grub/grub.cfg to generate a new menu after removing or installing other kernels. But obviously /boot/grub/grub.cfg is wrong, at least for me (the subdir grub doesnt exist here). In my case the file is under /efi/grub/grub.cfg. Is that also OK? When mounting ESP I followed https://wiki.archlinux.org/title/EFI_system_partition#Mount_the_partition#Typical_mount_points and chose the 2nd variant.

  • Many thx. Worked fine.

    If I install a new kernel, I have to recreate the entries with grub-mkconfig -o /boot/grub/grub.cfg. But do I have to do that also for kernel updates?

    I don't think so, because the filename should not change, if I'm right?

  • Arch Linux @lemmy.ml

    Howto Install bootloader afterwards?

  • Ahh ok. Since in this case the script should only run at start and then exit, I use oneshot. Many thx.

  • Yep, I know. But when I only depend on

     
        
    After=network-online.target
    Wants=network-online.target
    
    
      

    this doesn't mean, I have a working internet connection. That's why the loop.

    Or is that wrong?

  • What's the difference between oneshot and simple?

  • Nice. I will try the systemd unit. Meanwhile, i have added a loop in the script, which helps a little bit:

     
        
    maxwait=15
    if [[ $(nm-online -x) != *"online"* ]]; then
    	echo "missing internet connection, waiting..."
    	for (( i = 1; i <= maxwait; ++i )); do
    		sleep 1 &
    		echo $i
    		if [[ $(nm-online -x) == *"online"* ]]; then
    			break
    		fi
    
    		if [[ $i -eq $maxwait ]]; then
    			echo "No internet connection"
    			exit 1
    		fi
    		wait
    	done 
    fi
    
      

    In my test, this exits the script after 15 seconds without connection, but continues, when the connection is available or is established within this time.

    But i think, its a nice idea, to add this to the script AND use the systemd unit together.

  • Arch Linux @lemmy.ml

    How to start a script after logging in AND WiFi is ready?

  • Many thx. I hadn't referred to groups, but at least that's how it makes sense.

  • I uninstalled Steam with pacman -Runs steam. After that there were still several folders within my home. I removed these and then installed steam with pacman -Syu steam aga in. Luckily I didn't need to reinstall the games as they are installed on a separate partition. I simply remounted the library and can now start the games without any error messages. Thanks for your help.

    BTW: Whats the difference between pacman -Rns and pacman -Runs? What does u mean?

  • Do you know which locations, i have to remove?

  • Arch Linux @lemmy.ml

    Games no longer start under steam

  • Cromite, KeepassDX, Moshidon, Phone, K9

  • Unfortunately, logrotate does not work the way I would like it to. I have now created a bash script, which hopefully does what it is supposed to do:

     
        
    #!/bin/bash
    keepCount=30
    
    files=($(ls *.db))
    fileCount=${#files[@]}
    
    for (( i=0; i<$fileCount; i++ )); do
    	database="${files[$i]}"
    	dbarr=($(ls -t $database.*))
    
    	for index in "${!dbarr[@]}"; do
    		p=$((index+1))
    		if [ $p -gt $keepCount ]; then
    			rm ${dbarr[$index]}
    		fi
    	done
    done
    
      

    Invoked in the respective directory, all *.db files are read into an array, as there can be different DBs per user. The array is then processed in a loop. First, the backup files for the respective DB are read into the array again, sorted by age. This array is then processed and all files whose index +1 is greater than keepCount are removed. This means that the oldest files are always removed and only those that are defined in the keepCount are kept.

    Its a little bit more complicated, but it seems to do the job.

  • Linux @discuss.tchncs.de

    cp with backup, limit count

  • Jerboa @lemmy.ml

    Bigger thumbnails?

  • Linux Questions @lemmy.zip

    How to find the name for Icon in *.desktop file?

  • Raspberry Pi @feddit.org

    ffmpeg Hardware encoding Auflösung

  • Darktable @lemmy.world

    Filter in lighttable not working

  • USB Debugging is disabled, when im travelling. I had two such situations last week. At the first, i had enough time to shutdown and lock the device, before that. But the second time, they asked to unlock the device. I have no idea, if they can force me to do that, when a password is set, instead of only a fingerprint. But i don't want to risk anything. Its not that i have to hide something. There is nothing on the phone what is not allowed. Only 2 VPN connections, which is not that good in China and some other countries. One for access to my home network and the other which i use in public networks.

    I don't want to have any problems with the authorities (in any country). As long as I don't have to hand over the device, they can have a look at what's on the phone. But I also don't want anything to be installed that doesn't belong there and I want to use my VPN the way I want to.

    The second situation, was the first time in my travelling, when someone asked me to unlock the device. They didn't take it with them after unlocking it (unlike the situation where it wasn't unlocked) but I don't see what could stop them from doing so.

  • That's not the point. I travel a lot and here the phone is occasionally checked by the local authorities. I have no control over what the Chinese authorities do with the phone when they take it with them. Needless to say, I don't plug the phone into any USB ports myself. The fact that apps from the Playstore are not affected by this is also OK, but I have installed very few apps via the Playstore, most of them are from F-Droid.

    To make a long story short: There were several such situations on my last trip and I was happy that I had this “Auto Blocker” active. But it's not a permanent solution.

  • F-Droid @lemmy.ml

    F-Droid and Samsung "Auto Blocker"

  • Many thx. This is exactly what I want. Will try that when I'm batch from vacation.

  • Linux @lemmy.ml

    Autocomplete custom scripts?

  • Linux Questions @lemmy.zip

    Icon with Desktop Notifications

  • Arch Linux @discuss.tchncs.de

    Remove Gnome with its settings?

  • Free and Open Source Software @beehaw.org

    Roundcube Photos 1.5.6

    codeberg.org /Offerel/Roundcube_Pictures
  • Firefox @lemmy.ml

    Saving Formdata is not working

  • Darktable @lemmy.world

    What to backup before update to 5.0.x?

  • On mobile im using Cromite. At least for me very useful. I haven't tested it fully for privacy, but I don't see any unexpected http requests to spooky Google services or similar thing's.

  • Privacy @lemmy.ml

    Is Midori worth recommending?