[systemd-devel] empty a directory in service file as ExecStartPre

arnaud gaboury arnaud.gaboury at gmail.com
Sat Jan 2 05:13:04 PST 2016


On Sat, Jan 2, 2016 at 1:57 PM, Reindl Harald <h.reindl at thelounge.net> wrote:
>
>
> Am 02.01.2016 um 13:43 schrieb arnaud gaboury:
>>
>> ExecStartPre=/usr/bin/rm -f ${REPORTDIR}/
>
>
> ExecStartPre=/usr/local/scripts/emptydir.sh $REPORTDIR

Thank you, but I would prefer to avoid any external script.

I finally found the correct way, as I had to remove everything (lucky
all are files) except the one sub directory:

ExecStartPre=/usr/bin/find ${REPORTDIR} -mindepth 1 -type f -delete

>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>



-- 

google.com/+arnaudgabourygabx


More information about the systemd-devel mailing list