diff options
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service b/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service new file mode 100644 index 000000000..852027209 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service @@ -0,0 +1,11 @@ +[Unit] +Description=Overlay sync to NV storage + +[Service] +# Run rsync periodically to sync the overlay to NV storage +ExecStart=bash -c 'while true; do rsync -a --delete /tmp/.overlay/ /tmp/.rwfs/.overlay; sleep 20; done' +# On shutdown, archive the bash history so we don't lose it and run one last sync +ExecStop=bash -c 'history -a; rsync -a --delete /tmp/.overlay/ /tmp/.rwfs/.overlay' + +[Install] +WantedBy=multi-user.target |