$ export EDITOR=nanobefore using the crontab command:
$ crontab -ewhich will start the editor (or vi) and load the current cron table file for this user, or a blank file if none exists.
#mh hd dm my dw command(every line starting with a pound symbol (#) is a comment) because it reminds me that the space separated fields are:
/usr/bin/top -n 1 -b -SNotice that I used the whole path to the top executable. Since cron jobs may not provide the same working environment (path, aliases, ...) I get at the command prompt, it is wise to use full paths to all commands and scripts I use. I test the command a couple times to make sure I get the output I thought I was going to get. The output of this command (by default) will be sent to my user via email whenever this cron job executes.
0 12 * * * /usr/bin/top -n 1 -b -SThis command will execute every day at noon. The first five fields can be values, lists, ranges, or ranges with step values.
0 0,6,12,18 * * * /usr/bin/top -n 1 -b -Swhich adds midnight (0), 6 am (6), and 6 pm (18) to the times this job will execute, in addition to the original time of noon (12).
0 0,6,12,18 * * 1-5 /usr/bin/top -n 1 -b -Smaking the 'top' cron job execute four times a day, but only on weekdays (Monday through Friday). A list may also include a range in place of one (or more) of its values, like this:
0 0,6,9-15,18 * * 1-5 /usr/bin/top -n 1 -b -Swhich would allow this cron job to execute every hour from 9 am (9) until 3 pm (15), instead of just at noon (12).
0 0,6,12,18 * * * /usr/bin/top -n 1 -b -Sin this abbreiviated way:
0 */6 * * * /usr/bin/top -n 1 -b -Smeaning all possible values ('*' or '0-23') that are evenly divisible by 6 (0, 6, 12, and 18). This way of expressing lists makes it much easier to run a cron job every 5 minutes:
*/5 * * * * /usr/bin/top -n 1 -b -Sor every other day:
0 12 */2 * * /usr/bin/top -n 1 -b -Sin a way that is short, easy to read, and interpret.
*/10 * * * * /home/myuser/bin/pinghosts.sh > /home/myuser/pinghosts.logand every ten minutes the output of 'pinghosts.sh' will replace the contents of the file 'pinghosts.log' ('>' causes the output of the 'pinghosts.sh' command to overwrite the contents of the 'pinghosts.log' file) in my home directory (if 'myuser' is my username). If I want 'pinghosts.log' to be more like a regular log file, tracking output over time, I need to use a different redirection symbol:
*/10 * * * * /home/myuser/bin/pinghosts.sh >> /home/myuser/pinghosts.log('>>' cause the output of the 'pinghosts.sh' command to be appended to the 'pinghosts.log' file). If I plan to keep 'pinghosts.sh' output over time, I should make sure it doesn't produce more output that I have disk (or quota) space. I could just throw away the file when it gets to large, or maybe just every month or so (hmm...sounds like a job for cron).
*/10 * * * * /home/myuser/bin/pinghosts.sh >> /home/myuser/pinghosts.log 2>&1This works for shells like 'bash' (sh, ksh, zsh) and redirects STDERR (error output) to STDOUT (normal output), just after STDOUT has been redirected to the file 'pinghosts.log'.
0 19 * * 2 /home/myuser/bin/garbage-day-email.sh > /dev/null 2>&1but this will never alert me if the email is unsuccessful, so I may opt for this version:
0 19 * * 2 /home/myuser/bin/garbage-day-email.sh > /dev/nullinstead. This way, at 7 pm on Tuesday evenings I will get an email cheerfully reminding me of "garbage day", or an uglier error message that does the same (if email is working).
Adding Host
Go to C:\Windows\System32\drivers\etc
Nicholas C. Zakas was doing some prep work for his new book when he delved into browser cookie restrictions for the big four browsers:
The most interesting fact I discovered is that Safari places no limit
on the number of cookies that can be set per domain. In fact, you can
set enough cookies on the client to cause a server error as the cookie
header can be too long to parse.
He also found out that:
Cookie
header. The problem is that the header size exceeded the limit that the server could process, so an error occurred.So the prevailing knowledge that browsers limit per-domain cookies to 20 is no longer valid. Another interesting inconsistency is how browsers react when too many cookies are set. With the exception of Safari, which sets all cookies regardless of the number, there are two approaches:
The total size of cookies also varies from browser to browser. This is another one that is a little hard to comprehend, but here's what my tests show: