I need to send the output of 'top' to a file but I need to run it every minute.
I am using the following command which works when run from the command line:
top -n 1 -b > top-output.txt
This gives me the file top-output.txt with the results. However, when I add:
* * * * * /root/Desktop/top.sh
and I put that command in the .sh file I made and give it +x, it doesn't seem to run.
Can anyone tell me what I'm missing?