rm in ClientAfterJob does not work

20 views
Skip to first unread message

Leon Bartle

unread,
May 17, 2024, 4:28:04 AM5/17/24
to bareos-users
Calling a Backup Script in ClientBeforeJob does function correctly.
My ClientRunAfterJob has "rm -rf /tmp/backup/*" defined. 
The backup console logs 
JobId 415: shell command: run ClientAfterJob "rm -rf /tmp/backup/*"

But the files are not deleted.
What would be the best way to debug this?

Thanks in advance!

Spadajspadaj

unread,
May 17, 2024, 5:24:19 AM5/17/24
to bareos...@googlegroups.com
The script name/parameters are not subject to shell expansion. So your script literally tries to remove a file called *
If you want shell expansion, you have to do it as

bash -c "rm -rf /tmp/backup/*"

MK

-- Wysłane za pomocą K-9 Mail.

Leon Bartle

unread,
May 21, 2024, 4:50:46 AM5/21/24
to bareos-users
Thanks! That worked
Reply all
Reply to author
Forward
0 new messages