Open Archie-2021 opened 1 year ago
trash-empty
can detect if it is working on cron it will not ask any confirmation. If not this would be a bug.
In any case you can force the non-interactive mode using the -f
flag.
Thanks for clearifying as I could not find the -f
option in documnetation. It is working now with cron as I am testing it, I was using anacron and it didn't work even with the -f
flag, still not sure if I am not using anacron correctly or it is another issue.
I think because anacron runs as root trash-empty applies to the root account. In that case is there a way to specify which user trash to clean? Everything works fine otherwise, It is the only explanation that comes to my mind.
I think because anacron runs as root trash-empty applies to the root account. In that case is there a way to specify which user trash to clean?
I don't know anacron, but to run a command with another user when you are root you can use this command:
sudo -u your-user trash-empty 100
I think because anacron runs as root trash-empty applies to the root account. In that case is there a way to specify which user trash to clean?
I don't know anacron, but to run a command with another user when you are root you can use this command:
sudo -u your-user trash-empty 100
This one works, the issue was ownership of the process.
Thank you
Sorry if it is a newbie question, but I am trying to use cron to empty the trash as a test and noticed it is not working because there is a prompt after running the command and I can't find any option in the man page to disable that. So how I can set up a cronjob (possibly an anacron job) with this?
Thank you.