This video explains the method on how to schedule a cronjob to run a script on any Linux machine. Crontab allows users to schedule and run jobs at any given time.
Hello @AspiringArchitect. Thanks a lot for this video. I want more explaination if i want to do a crontab to restart my wildfly application every sunday of a week ? I try but... Could you help ?
Hello sir I'm creating a file in vi It is not created file It's thorwing an you have new mail in /var/spool/mail/root Tell me sir how can I create a file in vi
It seems like you're encountering an issue while trying to create a file using the vi text editor. The message "you have new mail in /var/spool/mail/root" might be unrelated to creating a file in vi and is actually indicating that you have new email messages in the root user's mailbox. Type the following command to create and open a new file using vi: vi filename Replace "filename" with the name you want to give to your new file. Press Enter. You will be in the vi text editor. To start typing and adding content to the file, press the "i" key. This will put vi into insert mode, allowing you to type and edit the file. Type or paste the content you want in the file. When you're done editing the file, press the "Esc" key to exit insert mode. To save the file and exit vi, you can type :wq and then press Enter. This command means "write" (save) and "quit" (exit). If you just want to save the file without exiting vi, you can use the :w command. To exit vi without saving changes, you can use the :q! command. Remember to replace "filename" with the actual name you want to give to your file. If you're still having issues or encountering any error messages, please provide more details about the specific problem you're facing, and I'll be happy to assist you further.
Sir thanks for the video, I wish to ask you this question. When creating the script using the vi editor why do you not start as #! /bin/bas Before passing the touch command on the next line???
In Unix-like operating systems, when you create a script using the vi editor (or any other text editor), you can start the script with a shebang line (also known as a hashbang or a pound-bang line), which specifies the interpreter that should be used to execute the script. The shebang line begins with #! followed by the path to the interpreter. For example, if you're writing a Bash script, you would typically start your script with: #!/bin/bash So, to directly address your question, if you're using the vi text editor to create a script, it's a good practice to start with the shebang line, like #!/bin/bash, before any other commands in the script. This ensures that when you make the script executable and run it, the correct interpreter (in this case, Bash) will be used.
Cron does not go down to sub-minute resolutions, ie.. Cron job cannot be used to schedule a job in seconds interval. Therefore you cannot schedule a cron job to run every 30 seconds. The alternative way is to write a shell script that uses ‘sleep 30’ command in it.
i have small problem in my kubernates pods some times not working and im daily manul restart all pods but im write script i dont now script ,,, your who to write script in this issue mr partha saradi
bro.. i have a one doubt, How can we do for crontab jobs automatic backup, i mean all crontab jobs need to automatic backup. to store in an other location daily once... can please help me..
I will tell you this way.. we have 50 servers and maintaining about 40 jobs in each. Those jobs need to backup automatic daily(day by day with the date) once in separate server. If any body trying to change or when we increase and decrease we can easily find , when it happend who did that.. This is the cause..
Best video I've seen explaining this so far. Thanks :)
Glad it was helpful!
One of best video to schedule job i loved ur explanation very very nice
Well explained sir
Hello @AspiringArchitect.
Thanks a lot for this video.
I want more explaination if i want to do a crontab to restart my wildfly application every sunday of a week ? I try but... Could you help ?
Hello sir
I'm creating a file in vi
It is not created file
It's thorwing an you have new mail in /var/spool/mail/root
Tell me sir how can I create a file in vi
It seems like you're encountering an issue while trying to create a file using the vi text editor. The message "you have new mail in /var/spool/mail/root" might be unrelated to creating a file in vi and is actually indicating that you have new email messages in the root user's mailbox.
Type the following command to create and open a new file using vi:
vi filename
Replace "filename" with the name you want to give to your new file.
Press Enter.
You will be in the vi text editor. To start typing and adding content to the file, press the "i" key. This will put vi into insert mode, allowing you to type and edit the file.
Type or paste the content you want in the file.
When you're done editing the file, press the "Esc" key to exit insert mode.
To save the file and exit vi, you can type :wq and then press Enter. This command means "write" (save) and "quit" (exit).
If you just want to save the file without exiting vi, you can use the :w command. To exit vi without saving changes, you can use the :q! command.
Remember to replace "filename" with the actual name you want to give to your file. If you're still having issues or encountering any error messages, please provide more details about the specific problem you're facing, and I'll be happy to assist you further.
Sir thanks for the video, I wish to ask you this question. When creating the script using the vi editor why do you not start as #! /bin/bas
Before passing the touch command on the next line???
In Unix-like operating systems, when you create a script using the vi editor (or any other text editor), you can start the script with a shebang line (also known as a hashbang or a pound-bang line), which specifies the interpreter that should be used to execute the script. The shebang line begins with #! followed by the path to the interpreter.
For example, if you're writing a Bash script, you would typically start your script with:
#!/bin/bash
So, to directly address your question, if you're using the vi text editor to create a script, it's a good practice to start with the shebang line, like #!/bin/bash, before any other commands in the script. This ensures that when you make the script executable and run it, the correct interpreter (in this case, Bash) will be used.
Thanks
For every 30sec i need to run the command...
*/.30 * * * * is this correct command
Cron does not go down to sub-minute resolutions, ie.. Cron job cannot be used to schedule a job in seconds interval. Therefore you cannot schedule a cron job to run every 30 seconds. The alternative way is to write a shell script that uses ‘sleep 30’ command in it.
i have small problem in my kubernates pods some times not working and im daily manul restart all pods but im write script i dont now script ,,, your who to write script in this issue mr partha saradi
How can add 1 additional column in crontab script also how to change config for adding 1 column in exiting script
If you are looking to add another entry, you can use "crontab -e". To later verify list them using "crontab -l"
Can you say how can I check whether a scheduled job is running or not
To list the active cronjobs you can do a "crontab -l"
will you teach linux course in online can u please share the details?
bro.. i have a one doubt, How can we do for crontab jobs automatic backup, i mean all crontab jobs need to automatic backup. to store in an other location daily once... can please help me..
By backing up do you mean maintaining a copy of the log files being generated? If so, you can develop a script with cp commands.
I will tell you this way.. we have 50 servers and maintaining about 40 jobs in each. Those jobs need to backup automatic daily(day by day with the date) once in separate server.
If any body trying to change or when we increase and decrease we can easily find , when it happend who did that..
This is the cause..
Thx u
How to check script is working or not
You can verify the output of your script.
You can run, echo $?, if outcome shows value 0 then its correct if 1 then thr may be error