Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
- Posts: 1
- Joined: Fri Sep 04, 2020 5:02 pm
Was looking to automate dietpi-backup
with cron and ensure that no user interaction is required. The solution I found said to set the G_USER_INPUT=0
but I guess that has changed since a couple of years ago. After digging though the code, the way to do it is to set the G_INTERACTIVE=0
before any command
Code: Select all
G_INTERACTIVE=0 /boot/dietpi/dietpi-backup 1
hope this saves someones time
- Site Admin
- Posts: 2779
- Joined: Sat Nov 18, 2017 6:21 pm
Jep G_INTERACTIVE is the direct replacement for G_USER_INPUT for a while. Within cron jobs it should though not be required as it's set to 0 automatically when non input terminal is found (STDIN is no terminal => [ -t 0 ] returns false). Same for systemd services. But it doesn't hurt to set it. If so export it to assure it's set for all sub scripts as well.