mirror of
https://github.com/LeCoupa/awesome-cheatsheets.git
synced 2026-01-29 14:48:01 -08:00
Compare commits
8 Commits
b439f2911f
...
9d1bcbf6ac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d1bcbf6ac | ||
|
|
559d03ecf3 | ||
|
|
bea751612a | ||
|
|
d143c60246 | ||
|
|
44371217a9 | ||
|
|
d63d75bb28 | ||
|
|
94087440e5 | ||
|
|
79d446245e |
@@ -185,7 +185,6 @@ width="" <!-- Describes the width of th
|
|||||||
<!-- Some other useful tags -->
|
<!-- Some other useful tags -->
|
||||||
|
|
||||||
<canvas></canvas> <!-- Allows to draw 2D shapes on the web page with the help of javascript -->
|
<canvas></canvas> <!-- Allows to draw 2D shapes on the web page with the help of javascript -->
|
||||||
<keygen> <!-- Represents a control for generating a public-private key pair -->
|
|
||||||
<map></map> <!-- Specifies an image map -->
|
<map></map> <!-- Specifies an image map -->
|
||||||
|
|
||||||
<!-- Collective Character Obejcts -->
|
<!-- Collective Character Obejcts -->
|
||||||
|
|||||||
68
tools/cronjob.txt
Normal file
68
tools/cronjob.txt
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
CRONTAB, is a time-based job scheduler in Unix like operating systems.
|
||||||
|
In laymen term, it is used to execute scripts on your machine at a predefined time or interval.
|
||||||
|
This can be any script, for instance downloading images from a particular website every hour or generating a pdf of your unread emails from the past day and the list goes on
|
||||||
|
|
||||||
|
|
||||||
|
###################################
|
||||||
|
BASICS
|
||||||
|
###################################
|
||||||
|
|
||||||
|
Each line of a crontab represents a job and it looks as follows:
|
||||||
|
|
||||||
|
* * * * * command_name
|
||||||
|
|
||||||
|
Each asterisk here has a special meaning :
|
||||||
|
Asterisk 1 : Represents minutes from 0 to 59
|
||||||
|
Asterisk 2 : Represents hour of the day from 0 to 23
|
||||||
|
Asterisk 3: Represents day of the month from 1 to 31
|
||||||
|
Asterisk 4: Represents a month from 1 to 12
|
||||||
|
Asterisk 5: Represents the day of the week from 0 to 6 (Sunday to Saturday)
|
||||||
|
Command : A command that executes a script
|
||||||
|
|
||||||
|
Example : 0 10 * * * /bin/bash print_time.sh
|
||||||
|
You can play with these settings from the following site : https://crontab.guru
|
||||||
|
|
||||||
|
The above example will execute the script print_time.sh using the /bin/bash shell, everyday at 10:00 A.M.
|
||||||
|
Crontab uses a 24 hour clock
|
||||||
|
Providing the full path to the script is necessary
|
||||||
|
Providing a shell name or a specific interpreter is necessary too
|
||||||
|
|
||||||
|
We can also use the following strings to define job.
|
||||||
|
|
||||||
|
@reboot Run once, at startup.
|
||||||
|
@yearly Run once a year.
|
||||||
|
@annually (same as @yearly).
|
||||||
|
@monthly Run once a month.
|
||||||
|
@weekly Run once a week.
|
||||||
|
@daily Run once a day.
|
||||||
|
@midnight (same as @daily).
|
||||||
|
@hourly Run once an hour.
|
||||||
|
|
||||||
|
@reboot <command-to-execute> # run a job every time the system reboots
|
||||||
|
|
||||||
|
###################################
|
||||||
|
CREATING CRONTAB JOBS
|
||||||
|
###################################
|
||||||
|
|
||||||
|
crontab -e # this opens up the crontab file in your predefined editor
|
||||||
|
|
||||||
|
# create a basic cronjob that runs everyday at 10:00 A.M.
|
||||||
|
0 10 * * * /bin/bash ~/Documents/collect_log.sh
|
||||||
|
|
||||||
|
- this cronjob will get executed everyday at 10:00 AM
|
||||||
|
- note the leading 0 is important
|
||||||
|
- /bin/bash is the interpreter here, and this is required
|
||||||
|
- ~/Documents/collect_log.sh is the absolute path to the script to be executed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
###################################
|
||||||
|
VIEW CRONJOBS FOR THE CURRENT USER
|
||||||
|
###################################
|
||||||
|
crontab -l
|
||||||
|
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
REMOVE ALL CRONJOBS FOR THE CURRENT USER
|
||||||
|
##########################################
|
||||||
|
crontab -r
|
||||||
@@ -105,7 +105,7 @@ gu$ make lowercase until end of line
|
|||||||
<< indent line one column to left
|
<< indent line one column to left
|
||||||
== auto-indent current line
|
== auto-indent current line
|
||||||
ddp swap current line with next
|
ddp swap current line with next
|
||||||
ddkp swap current line with previous
|
ddkP swap current line with previous
|
||||||
:%retab fix spaces / tabs issues in whole file
|
:%retab fix spaces / tabs issues in whole file
|
||||||
:r [name] insert the file [name] below the cursor.
|
:r [name] insert the file [name] below the cursor.
|
||||||
:r !{cmd} execute {cmd} and insert its standard output below the cursor.
|
:r !{cmd} execute {cmd} and insert its standard output below the cursor.
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
|
|
||||||
#### General
|
#### General
|
||||||
|
|
||||||
- `Ctrl`+`Shift`+`P`, `F1`: Show Command Palette
|
- `Ctrl`+`Shift`+`P`, `F1`: Show Command Palette
|
||||||
|
- `Ctrl`+`Shift`+`T`: Open last closed tab
|
||||||
- `Ctrl`+`P`: Quick Open, Go to File
|
- `Ctrl`+`P`: Quick Open, Go to File
|
||||||
- `Ctrl`+`Shift`+`N`: New window/instance
|
- `Ctrl`+`Shift`+`N`: New window/instance
|
||||||
- `Ctrl`+`W`: Close window/instance
|
- `Ctrl`+`W`: Close window/instance
|
||||||
|
|||||||
Reference in New Issue
Block a user