The problem is that we don't have EASY root access to servers. That's why being able to run logrotate without being root is very handy. This is what I did after following articles on the internet.
Create a directory /home/techyman/logrotate with two files logrotate.conf and logrotate.status
Put your logrotate configuration files there in logrotate.conf
This runs everyday at 1 AM.
To test every 1 second, just do * * * * * in cron job.
But it's not working. When I force it, it says "bad line at top in status file", otherwise no actions are being seen. I just see application.log alone.
How do I fix this issue? What am I doing wrong?
I removed notifempty and still it's not working.
I removed su techyman techyman and it it still not working.
The first thing is to know if the script runs when you execute it in your terminal, if it doesn't, solve that before trying in batch mode
Next, if it does, but not when calls by cron, go and look the cron logs, but most certainly you have an issue with your environment, remember cron is dumb... in other words you have something in your environment when you connect as user techyman that cron ignores and needs desperately...
Since your cron from what I understand is run by the user, the su will just add possibly more issues, you don't need it...
cron when is invoked opens an sh as the user, only it does not read your .profile, so it knows nothing of your env. and has a minimalistic PATH set...
As I already mentioned in my previous post, if it works in command line, you as user have in your profile something cron needs... you have set something in your environment that is needed by cron to execute what you want, it can be its the path, libpath or variables that are set etc...