summaryrefslogtreecommitdiff
path: root/meta-openbmc-mods/meta-common/recipes-core/nv-sync/nv-sync/nv-sync.service
blob: f5210dd5bfc27325ad22251fe603d0713b0e797e (plain)
1
2
3
4
5
6
7
8
9
10
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; sync /tmp/.rwfs/.overlay; sleep 10; 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; sync /tmp/.rwfs/.overlay; sleep 5'

[Install]
WantedBy=multi-user.target