blob: e965fdf1e675b248004b60a099058f1ad14b38bb [file] [log] [blame]
Jan Kundrát41d2d262017-10-27 18:29:33 +02001[Unit]
2Description=Persisting persistent sysrepo datastores to /cfg
Jan Kundrátd595c952018-08-22 19:17:31 +02003After=sysrepod.service cfg.mount
Jan Kundrát41d2d262017-10-27 18:29:33 +02004Requires=cfg.mount
5
6[Service]
7Type=simple
Jan Kundrát6b365482020-03-07 16:35:14 -08008ExecStart=/bin/sh -c 'while true; do inotifywait -e CLOSE_WRITE /etc/sysrepo/data/*.startup /etc/sysrepo/data/*.persist && mkdir -p /cfg/etc/sysrepo/data/ && cp -a /etc/sysrepo/data/*.startup /etc/sysrepo/data/*.persist /cfg/etc/sysrepo/data/; done'