zoukankan      html  css  js  c++  java
  • Python全栈_Day10_nfs和计划任务

    1. nfs

    1.1 安装

    yum install rpcbind nfs-utils -y

    1.2 配置

    配置文件路径:/etc/exports

    NFS配置文件格式:

        <共享目录>  <客户端1>(选项)  <客户端2>(选项)

        共享目录:NFS服务端共享给客户端的目录

        客户端:网络中能访问这个共享的主机,多个客户端使用空格分开

        选项:设置目录的权限,用户映射等。多个选项使用逗号隔开。

        常用选项包含:

          sync:以同步方式执行文件系统的输入输出动作。
          async:以非同步的方式执行文件系统的输入输出动作。
          ro:以只读模式加载。
          rw:以读写方式加载。
          defaults:使用默认的选项。默认选项为rw、suid、dev、exec、anto nouser与async。
          atime:每次存取都更新inode的存取时间,默认设置,取消选项为noatime。
          noatime:每次存取时不更新inode的存取时间。
    实例:/share 192.168.16.185(rw,sync)

    1.3启动

    systemctl start rpcbind

    systemctl start nfs

    1.4 客户端挂载

    mount 服务端ip:共享目录 目标目录

    2. 计划任务

    crond服务分为系统计划任务和用户计划任务。

        系统级计划任务:修改配置文件/etc/crontab 文件,来创建计划任务。

        用户级计划任务:普通用户直接使用crontab -e命令编辑自己的计划任务。root管理员可以使用crontab -e -u [用户名]来修改某一用户的计划任务。所有用户定义的crontab文件都被保存在/var/spool/cron目录中。

      3)crontab文件格式:用户级和系统级的文件格式都是一样的。 

      # Example of job definition:
      # .---------------- minute (0 - 59)     //分钟(0-59)
      # | .------------- hour (0 - 23)    //小时(0-23)
      # | | .---------- day of month (1 - 31)  //日期(1-31)
      # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... 月份(1-12)或者使用月份的英文简写
      # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat     //星期几(0-6)或者使用星期的英文简写
      # | | | | |
      # * * * * * user-name command to be executed                 //username:谁来执行这个任务      command to be executed:要执行的命令

      4)crontab命令参数:

        -u:指定用户

        -e:编辑某个用户计划任务

        -l:显示某个用户的计划任务内容

        -r:删除某个用户的计划任务

        -i:在删除用户文件时会提示确认

  • 相关阅读:
    LeetCode212. Word Search II
    LeetCode132. Palindrome Partitioning II
    LeetCode239. Sliding Window Maximum
    LeetCode解题报告—— Interleaving String
    LeetCode解题报告—— Maximal Rectangle
    LeetCode解题报告—— Minimum Window Substring && Largest Rectangle in Histogram
    LeetCode解题报告—— N-Queens && Edit Distance
    LeetCode解题报告—— Trapping Rain Water
    在CentOS上安装第三方软件库EPEL
    lunix存取windows共享文件夹
  • 原文地址:https://www.cnblogs.com/chenrenjian/p/6938416.html
Copyright © 2011-2022 走看看