⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0275-0278.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:




<HTML>

<HEAD>

<TITLE>Developer.com - Online Reference Library - 0672311623:SAMS TEACH YOURSELF LINUX IN 24 HOURS:Personal Productivity Tools</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311623 //-->

<!-- TITLE=SAMS TEACH YOURSELF LINUX IN 24 HOURS //-->

<!-- AUTHOR=BILL BALL, STEPHEN SMOOGEN //-->

<!-- PUBLISHER=MACMILLAN //-->

<!-- IMPRINT=SAMS //-->

<!-- PUBLICATION DATE=1998 //-->

<!-- CHAPTER=18 //-->

<!-- PAGES=0271-0280 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->







<P><CENTER>

<a href="0271-0274.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0279-0280.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-275"><P>Page 275</P></A>







<P>

directory. You can read this manual page as follows:

</P>



<!-- CODE SNIP //-->

<PRE>

# man 5 crontab

</PRE>

<!-- END CODE SNIP //-->





<P>Your crontab file should contain settings to start programs you want to run at regular

and even not-so-regular times, for example:

</P>

<!-- CODE SNIP //-->

<PRE>

* * * * * somecommand

0,15,30,45 * * * * somecommand

0 * * * * somecommand

</PRE>

<!-- END CODE SNIP //-->





<P>The first example shows you'd like to run a program every minute. The second

crontab entry runs a program every 15 minutes. The third example shows you'd like to run

a program once an hour, on the hour.

</P>





<P>If you'd like to run a program once a day at an appointed time, you can use:

</P>

<!-- CODE SNIP //-->

<PRE>

30 7 * * * somecommand

30 0  * * * somecommand

15 16 * * * somecommand

</PRE>

<!-- END CODE SNIP //-->





<P>The first example runs at 7:30 a.m. The second example runs at 30 minutes past

midnight. The third example runs at 4:15 p.m. each day. You can also run a program on a

specific day of the month or the week, for example:

</P>

<!-- CODE SNIP //-->

<PRE>

30 16 1 * * somecommand

30 15 * * mon somecommand

</PRE>

<!-- END CODE SNIP //-->





<P>The first example runs at 4:30 p.m. on the first day of each month, and the second

runs at 3:30 p.m. each Monday. To round out these examples, you can also specify a

particular month, or example:

</P>





<!-- CODE SNIP //-->

<PRE>

30 7 25 12 * somecommand

</PRE>

<!-- END CODE SNIP //-->





<P>This command runs the command at 7:30 a.m. on each December 25. The

commands you specify can also be system utilities or even your own shell scripts. You can use

the crontab command's -l (list) option to print your

cron settings, for example:

</P>



<!-- CODE //-->

<PRE>

# crontab -l

# DO NOT EDIT THIS FILE - edit the master and reinstall.

# (/tmp/crontab.1911 installed on Mon Dec  8 18:52:52 1997)

# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)

0,30 * * * * /usr/local/bin/saytime

0 8 * * * * /usr/local/bin/ppp on

3 8 * * * * /usr/local/bin/popclient -u bball -p mypasswd staffnet.com

</PRE>

<!-- END CODE //-->





<P>This shows a crontab file that speaks the time every half hour, starts a PPP connection

at 8 a.m. every day, and downloads the day's mail three minutes after the PPP

connection has started. You can remove your

crontab file with the crontab command's -r (remove)

option, for example:

</P>





<!-- CODE SNIP //-->

<PRE>

# crontab -r

</PRE>

<!-- END CODE SNIP //-->





<P>Using the crontab command is an easy way to create, run, and manage regular tasks.

Even

</P>

<A NAME="PAGENUM-276"><P>Page 276</P></A>







<P>

though you can create your own reminders, you'll want to use a calendar for short-

or long-range planning.

</P>



<H3><A NAME="ch18_ 6">

Creating Appointment Reminders with the X11 ical Client

</A></H3>





<P>You can use Sanjay Ghemawt's ical calendar to store appointments and reminders in

a personal calendar. The ical client, found under the

/usr/X11R6/bin directory, has a number of unique features and improvements over the cal or gcal calendar printing programs:

</P>





<UL>

<LI>          Custom graphical X11 interface with menus, dialogs, sliding controls,

and buttons

<LI>          Copy and paste, drag-and-drop notes, and appointments

<LI>          Alarms for upcoming events

<LI>          Multiple calendar views

<LI>          Import, export, and autosaving of calendar files

<LI>          Group sharing of calendar files

<LI>          Printing of different calendars

<LI>          cron-type scheduling of appointments, notes, or reminders

<LI>          To-do checklists

<LI>          Built-in help

</UL>



<P>When you first run ical, the program shows the current month, set to the current 

day, along with a note, or appointment entry list on the right. The ical client also uses 

many of the standard X Toolkit command-line options, so you can change geometry 

settings to set the initial calendar size, or start the ical client as an icon, for example:

</P>



<!-- CODE SNIP //-->

<PRE># ical -iconic</PRE>

<!-- END CODE SNIP //-->



<P>or

</P>



<!-- CODE SNIP //-->

<PRE># ical -geometry 800x600</PRE>

<!-- END CODE SNIP //-->



<P>Figure 18.1 shows the ical client.</P>



<P>Notices are created by selecting a day, then clicking on and typing in the box below 

the calendar. Appointments for the day are created by clicking on a specific time, and 

typing in the name of the appointment. You can drag appointments anywhere during 

the day to rearrange your schedule by holding down the middle mouse button (or both left and 

right mouse buttons if you're using a two-button mouse).



<A NAME="PAGENUM-277"><P>Page 277</P></A>



<P>Figure 18.1.

<P>The ical X11 client features notices, appointments, 

to-do lists, and reminder alarms.</P>

<a href="javascript:displayWindow('images/ch18fg01.jpg', 288, 216)"><img src="images/tn_ch18fg01.jpg"></a>



<P>

After you have set your notice or appointments, you can also set an alarm to have the 

ical client warn you of an upcoming event. To set a reminder alarm, first click on 

the appointment, then select the Item menu's Properties item to set an alarm for 

an appointment. You can also just double-click on the appointment to bring up the 

alarm dialog.

</P>

<P>You can tell ical to remind you from 1 to 15 days in advance, with up to 60 warnings 

the hour before an appointment. The ical alarm notice window will pop up at the 

preselected times as a reminder.

<P>





<TABLE BGCOLOR=#FFFF99><TR><TD>TIME SAVER</TD></TR><TR><TD><BLOCKQUOTE>

The ical client must be running in order to receive alarms. You can, however, 

use the ical command and its -popup command-line option in a 

crontab entry. If you use -popup, ical will list all of the day's appointments in a window, then exit 

after you press the Okay button.

</BLOCKQUOTE></TD></TR></TABLE>





<P>Figure 18.2 shows the ical client's alarm dialog.

</P>



<P>If you select an appointment or notice, you can also make it repeat daily, weekly, 

monthly, or annually by selecting the pertinent Repeat menu item. When you cause an item 

to </P>



<A NAME="PAGENUM-278"><P>Page 278</P></A>



<P>

Figure 18.2.

<P>The ical client's alarm dialog features multiple, cascading 

alarms, with drag-and-drop controls.</P>

<a href="javascript:displayWindow('images/ch18fg02.jpg', 288, 216)"><img src="images/tn_ch18fg02.jpg"></a><BR>







<P>repeat, it will automatically be duplicated in your calendar.

</P>



<P>Appointments can also be made to-do items, by clicking on the appointment, 

then selecting Todo from ical's Item menu. A box will appear at the beginning of the text. 

Until you complete the item by clicking in the box with your left mouse button to place a 

check mark, the to-do item will reappear on the next day's list of appointments.

</P>

<P>You can list your appointments and notices by using ical's List menu. If you'd like 

hard copy of your calendar, you can print six different built-in calendar formats, or 

specify a range of days. Before you print, you can also preview your calendar.

</P>

<P>The ical client is a convenient way to organize personal or group tasks. You'll also 

want to take a look at some of ical's companion shell scripts and programs under the 

/usr/lib/ical/contrib directory, to find tips and hints on how to customize ical to suit your needs.

</P>



<H3><A NAME="ch18_ 7">

Checking the Calendar and Keeping Appointments with 

emacs

</A></H3>



<P>The emacs text editor, more fully discussed in Hour 14, &quot;Text Processing,&quot; has a 

number of features that can help your personal productivity or even keep you amused. You 

can check the current calendar, see a list of holidays (and more), and keep a diary 

with 

</P>

<P><CENTER>

<a href="0271-0274.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="0279-0280.html">Next</A>

</CENTER></P>















</td>
</tr>
</table>

<!-- begin footer information -->









</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -