Hi,
On Mon, Apr 21 at 06:27, Tim wrote:
> Good evening on this damp squid of Easter
>
> I will admit that scripting is not my thing but at times I decide I am
> going to try and improve my scripting (it is basic).
>
> So here what my issue is, I want to delete some .log file from /var/log
> so I have a very simple one line script in home/mit/scripts called
> deletefile.sh
>
> Here is the one liner
>
> find /var/log/ -name "*.log" -type f -mtime +7 -delete
First I wouldn't start from here, see the package "logrotate".
But if you insist try adding the "shebang" header to the start of your
script.
#!/bin/sh
Regular shells have a default action if the shebang line is missing from
a text file you try to execute. sudo requires the line to be present.
Also you did remember to "chmod +x deletefile.sh" ?
--
Bob Dunlop
--
Next meeting: Online, Jitsi, Tuesday, 2025-05-06 20:00
Check to whom you are replying
Meetings, mailing list, IRC, ... https://dorset.lug.org.uk
New thread, don't hijack: mailto:[email protected]