免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1328 | 回复: 0
打印 上一主题 下一主题

crontab [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-07-05 17:10 |只看该作者 |倒序浏览
ps = pgrep


kill 后面接pid号
pkil 后面接进程名称


# at 9:00 pm
at>find /export/home/user2 -name core -exec rm {} \;
at>
commands will be executed using /sbin/sh
job 1016078400.a at Wed Mar 13 21:00:00 2002
To display information about the execution times of jobs, perform the
command:
# at -l 1016078400.a
To display the jobs queued to run at specified times by chronological
order of execution, perform the command:
# atq
Rank Execution Date Owner Job Queue Job Name
1st Mar 13, 2002 21:00 root 1016078400.a a stdin
2nd Mar 13, 2002 21:05 root 1016078700.a a stdin
3rd Mar 13, 2002 21:10 root 1016079000.a a stdin
To view all the at jobs currently scheduled in the queue, perform the
command:
# ls -l /var/spool/cron/atjobs
-r-Sr--r-- 1 root other 921 Mar 13 13:08 1016078400.a
-r-Sr--r-- 1 root other 913 Mar 13 13:08 1016078700.a
-r-Sr--r-- 1 root other 885 Mar 13 13:09 1016079000.a

For example, to remove job 1016078400.a from the at queue, perform
the command:
# at -r 1016078400.a
# atq
Rank Execution Date Owner Job Queue Job Name
1st Mar 13, 2002 21:05 root 1016078700.a a stdin
2nd Mar 13, 2002 21:10 root 1016079000.a a stdin


/etc/cron.d/at.deny这个文件是存用户名,一些不允许使用at命令的用户.文件默认是存在的,但是一个空文件
/etc/cron.d/at.allow存放可以使用at命令的帐户,默认是不存在的
The interaction between the at.allow and the at.deny files follows
these rules:
l If the at.allow file exists, only the users listed in this file can
execute at commands.
l If the at.allow file does not exist, all users, except for users listed in
the at.deny file, can execute at commands.
l If neither file exists, only the root user can use the at command.


# crontab -l查看
# crontab -e编辑
# crontab -r username 删指定文件

/etc/cron.d/cron.deny
/etc/cron.d/cron.allow
l If the cron.allow file exists, only the users listed in this file can
create, edit, display, or remove crontab files.
l If the cron.allow file does not exist, all users, except for users listed
in the cron.deny file, can create, edit, display, or remove crontab
files.
l If neither file exists, only the root user can run the crontab
command.






mt -f tape-device-name command count
The following command positions the tape at the beginning of the third
tape record.
# mt -f /dev/rmt/0n fsf 2



The following example shows how to perform a full (Level 0) backup of
the /export/home file system on the host1 system, to the remote tape
device on the host2 system.
# ufsdump 0uf host2:/dev/rmt/0 /export/home
DUMP: Writing 32 Kilobyte records
DUMP: Date of this level 0 dump: Thu 24 Jan 2002 01:13:55 PM MST
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t0d0s7 (host1:/export/home) to
host2:/dev/rmt/0.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 320 blocks (160KB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: Tape rewinding
DUMP: 318 blocks (159KB) on 1 volume at 691 KB/sec
DUMP: DUMP IS DONE
DUMP: Level 0 dump on Thu 24 Jan 2002 01:13:55 PM MST



1. Insert the Solaris 9 Software 1 of 2 CD-ROM, and boot the CD-ROM
with the single-user mode option.
ok boot cdrom -s
2. Create the new file system structure.
# newfs /dev/rdsk/c0t0d0s0
3. Mount the file system to the mount point /a and change to that
directory.
# mount /dev/dsk/c0t0d0s0 /a
# cd /a
4. Restore the / (root) file system from the backup tape.
# ufsrestore rf /dev/rmt/0
5. Remove the restoresymtable file.
# rm restoresymtable
6. Install the bootblk in Sectors 1 through 15 of the boot disk. To do
this, change to the directory that contains the bootblk, and enter the
installboot command.
# cd /usr/platform/`uname -m`/lib/fs/ufs
# installboot bootblk /dev/rdsk/c0t0d0s0
7. Unmount the new file system.
# cd /
# umount /a
8. Use the fsck command to check the restored file system.
# fsck /dev/rdsk/c0t0d0s0
9. Perform a full backup of the file system.
# ufsdump 0uf /dev/rmt/0 /dev/rdsk/c0t0d0s0
10. Reboot the system.
# init 6













本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/40476/showart_334948.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP