Posts

Showing posts from December, 2020

Crontab command

 crontab -l  to see all listed crontab tasks. crontab -e to add/edit crontab tasks. Inside the crontab editor, the command would be composed of  <scheduler> <run command> <the output> * * * * * /home/ae/code.sh >> output.txt 2>&1  Which.. the 1st star = minutes to start running the 2nd star = hours to start running the 3rd star = day of the month to start running the 4th star = month to start running the 5th star = day of the week to start running More info: https://www.geeksforgeeks.org/crontab-in-linux-with-examples/  

2>&1 in command means??

References.. 0 =  standard input  ( stdin ) 1 =  standard output  ( stdout )  2 =  standard error  ( stderr ) Hence, we can use command > output.log to print the std output stream, which is an implicit meaning of command 1>output.log Thus, the annex 2>&1 means print the std error to the same place as the std output.  Moreover, the we can hide the std output from printing out by using 2>/dev/null. Thanks to: https://linuxize.com/post/bash-redirect-stderr-stdout/ Learning bash: https://iridakos.com/programming/2018/03/01/bash-programmable-completion-tutorial