# \[howto\] call dietpi-sync 1 without user interaction

**URL:** https://dietpi.com/forum/t/howto-call-dietpi-sync-1-without-user-interaction/15964
**Category:** General Discussion
**Created:** [15 February 2023 13:13 UTC](https://dietpi.com/forum/t/howto-call-dietpi-sync-1-without-user-interaction/15964 "2023-02-15T13:13:25Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [21 February 2023 20:05 UTC](https://dietpi.com/forum/t/howto-call-dietpi-sync-1-without-user-interaction/15964/5 "2023-02-21T20:05:16Z")

</div>

> [@Ruud](#):
>
> This means that the dietpi-sync script behaves differently when run from the command line / scripted or from a cron script.

That is correct. Our scripts, respectively `dietpi-globals` automatically detects whether it executes within an interactive shell with a STDIN attached and sets `G_INTERACTIVE` accordingly to skip whiptail menus. This is needed to assure that exactly such hangs are ruled out.

If you want to test scripts for non-interactive environment, than indeed call them with preceding `export G_INTERACTIVE=0`. Don’t forgot to unset it again, otherwise you cannot call other scripts’ menus anymore 😉.

But you are right, the docs are not correct. We made the space check in dietpi-backup optional. I think we should do it similarly in dietpi-sync:

- Make dry run a dedicated menu entry to run a dry run only and test settings that way.
- Make free space check (which includes a dry run) an option (disabled by default) for the real sync, which then only prompts in interactive environment if the free space check fails.
- Align with dietpi-backup, i.e. add a dedicated dry run option to dietpi-backup as well.

---

_[View the full topic](https://dietpi.com/forum/t/howto-call-dietpi-sync-1-without-user-interaction/15964)._
