When I look at the questions and answers on this forum, it seems like the threshold to ask a question is very high. At least for someone like me, with very little knowledge of Linux. Most of the questions about cron jobs are out of my league, including the answers. So with a little bit of embarrassment, I am going to ask the simplest questions.
I want to create a cron job that shows me the data/time every minute. I want to see this in real time, on the console. I am guessing that this will eventually be done through a bash script or Python, but for now, I want to use the command line.
crontab -e * * * * * /bin/date >> /home/pi/cron_date
I understand the concept of the stars. I have used the "which" command to find where "date" is. I am redirecting this "date" information to a file which has not been created yet, but will be created when I hit the Enter key, called cron_date.
I am using the editor "nano". Control + O is WriteOut (which I am guessing is save/save as).
File Name to Write: /tmp/crontab.D3AZm/crontab
Question 1: I have used the Enter key and let "nano" call it what it wants to. My cron_date file is still created under /home/pi. I understand that the file name "nano" is giving me is for a temporary file. But since I already have decided that I want this file as my own file, should I delete the "nano" suggestion and substitute it with:
File Name to Write: /home/pi/cron_date
or am I wondering about things I really don't have to think about? For now, I have been letting this temp file be named by "nano" and not substituting anything.
crontab: installing new crontab crontab -l
My file exists. The problem now is viewing the file realtime. I can see the date/time with:
nano cron_date cat /home/pi/cron_date
But I have to use the same commands to update the information. My only realtime view of this file is:
tail -f /home/pi/cron_date
Question 2: Is there a way where I can see the whole file being updated?
This is just the beginning of a hobby project I want to do. Take pictures with a Raspberry Pi of the bottom of a river. I will be making an amateur ROV. If my Raspberry Pi with camera is submerged under water, I want to measure the temp combined with the time. If it overheats I will be able to see that and turn on a fan. I might be barking up the wrong tree, but my understanding of cron jobs is where my project starts.
Raspberry Pi 1 model B: Which uses Debian.