How to schedule a Cron Job to run a script on Linux

  Рет қаралды 34,848

AspiringArchitect

AspiringArchitect

Күн бұрын

Пікірлер: 26
@rakeshh-g5l
@rakeshh-g5l 8 ай бұрын
One of best video to schedule job i loved ur explanation very very nice
@user-sf9gs2pg1b
@user-sf9gs2pg1b Жыл бұрын
Best video I've seen explaining this so far. Thanks :)
@aspiringarchitect209
@aspiringarchitect209 Жыл бұрын
Glad it was helpful!
@ruvuzairanziblaise6732
@ruvuzairanziblaise6732 2 ай бұрын
Thank you! this is very helpful, So, if i want to run one command in my router only every Friday at 09:00 am, what will it be? for example, to save the configuration of the router in that file. Thanks again.
@rambabuthandu3700
@rambabuthandu3700 9 ай бұрын
Well explained sir
@gomeagle1989
@gomeagle1989 Жыл бұрын
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 ?
@chrismbah597
@chrismbah597 Жыл бұрын
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???
@aspiringarchitect209
@aspiringarchitect209 Жыл бұрын
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.
@kondalakshmidevi698
@kondalakshmidevi698 Жыл бұрын
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
@aspiringarchitect209
@aspiringarchitect209 Жыл бұрын
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.
@rajeswaridevithota8777
@rajeswaridevithota8777 Жыл бұрын
will you teach linux course in online can u please share the details?
@bhupendramishra891
@bhupendramishra891 2 жыл бұрын
How can add 1 additional column in crontab script also how to change config for adding 1 column in exiting script
@aspiringarchitect209
@aspiringarchitect209 2 жыл бұрын
If you are looking to add another entry, you can use "crontab -e". To later verify list them using "crontab -l"
@moulijami530
@moulijami530 2 жыл бұрын
Can you say how can I check whether a scheduled job is running or not
@aspiringarchitect209
@aspiringarchitect209 2 жыл бұрын
To list the active cronjobs you can do a "crontab -l"
@Islamic-channel995
@Islamic-channel995 9 ай бұрын
Thanks
@Karupakalasrilekha
@Karupakalasrilekha 2 жыл бұрын
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..
@aspiringarchitect209
@aspiringarchitect209 2 жыл бұрын
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.
@Karupakalasrilekha
@Karupakalasrilekha Жыл бұрын
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..
@khajamohiddinpathan3446
@khajamohiddinpathan3446 2 жыл бұрын
How to check script is working or not
@aspiringarchitect209
@aspiringarchitect209 2 жыл бұрын
You can verify the output of your script.
@surajchavan160
@surajchavan160 2 жыл бұрын
You can run, echo $?, if outcome shows value 0 then its correct if 1 then thr may be error
@parthasaradhi2061
@parthasaradhi2061 2 жыл бұрын
For every 30sec i need to run the command... */.30 * * * * is this correct command
@aspiringarchitect209
@aspiringarchitect209 2 жыл бұрын
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.
@kovvurusubbu1460
@kovvurusubbu1460 Жыл бұрын
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
@dailyinternetclipz8624
@dailyinternetclipz8624 2 жыл бұрын
Thx u
Linux Remote Copy KodeKloud Engineer
2:07
AspiringArchitect
Рет қаралды 933
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 6 МЛН
Каха и лужа  #непосредственнокаха
00:15
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 34 МЛН
Amazing remote control#devil  #lilith #funny #shorts
00:30
Devil Lilith
Рет қаралды 15 МЛН
Linux Crash Course - Scheduling Tasks with Cron
19:25
Learn Linux TV
Рет қаралды 120 М.
My 5 Favorite Linux Shell Tricks for SPEEEEEED (and efficiency)
11:06
How to Schedule a Python Script with a Cron Job
9:27
Tony Teaches Tech
Рет қаралды 78 М.
Write Your Own Bash Scripts for Automation [Tutorial]
16:35
Null Byte
Рет қаралды 771 М.
BASH Environment | Aliases, Functions and Scripts
49:26
Joe Collins (EzeeLinux)
Рет қаралды 91 М.
Filtering .log files, with cat, grep, cut, sort, and uniq
15:36
Raspberry Pi - Crontab tutorial (How to Schedule Cron jobs)
19:55
Robotics Back-End
Рет қаралды 10 М.
BASH scripting will change your life
14:18
NetworkChuck
Рет қаралды 1 МЛН
Creator of git, Linus Torvalds Presents the Fundamentals of git
1:10:15
Developers Alliance
Рет қаралды 137 М.
Walking on LEGO Be Like... #shorts #mingweirocks
00:41
mingweirocks
Рет қаралды 6 МЛН