20190304今天学到了什么 crontab-pem-locale

  1. 用户的crontab文件在哪里? 手动输入命令和crontab执行不同?https://stackoverflow.com/questions/28864842/linux-bash-shell-script-output-is-different-from-cronjob-vs-manually-running-the https://stackoverflow.com/questions/10129381/crontab-path-and-user https://superuser.com/questions/170866/how-to-run-a-cron-job-as-a-specific-user                   针对第一问,当我使用crontab -e编辑时,然后又使用lsof -c /usr/bin/crontab 惊奇地看到crontab编辑的是它自己! ubuntu用户打开的文件/var/spool/cron/crontabs/ubuntu 怪不得下面也有个/var/spool/cron 但是你vim /usr/bin/crontab也是能看到文本内容的!
    可以在系统级cron文件(在/etc/cron.d/目录下,放置一个符合cron语法的文件,该文件中可以指定用户)中名。                                                                      
    man cron man crontab cron是一个守护进程,crontab用来管理不同用户的定时任务(直接编辑各用户配置文件)

crontab - maintain crontab files for individual users (Vixie Cron)
crontab is the program used to install, deinstall or list the tables used to drive the cron(8) daemon in Vixie Cron. Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly.

可以使用 ps axef查看每个进程的环境变量

In *ix, processes commonly inherit an environment from their parent process across fork+exec. They have the option of clearing the environment, but usually they don’t. You can see the process tree with ps axf, and you can see the environment variables by using ps axfe.
cron is commonly not a child of someone’s shell, so it’ll often have a different environment from your interactive shell. There’s a good chance cron’s going to be intentionally clearing its own environment somehow for consistency though.
https://stackoverflow.com/questions/10129381/crontab-path-and-user

在这里插入图片描述
2. pem文件是什么东西?登录ssh时可以使用几种办法验证? https://serverfault.com/questions/9708/what-is-a-pem-file-and-how-does-it-differ-from-other-openssl-generated-key-file https://stackoverflow.com/questions/991758/how-to-get-pem-file-from-key-and-crt-files
3. 语言设置和locales https://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue 这个不管用的话,使用:https://unix.stackexchange.com/questions/87116/what-do-i-need-to-do-with-man-cant-set-the-locale-make-sure-lc-and-lang
4. whereis和which搜索目录的不同?
which: current environment
>which returns the pathnames of the files (or links) which would be executed in the current environment, had its arguments been given as commands in a strictly
POSIX-conformant shell. It does this by searching the PATH for executable files matching the names of the arguments. It does not follow symbolic links.

where:
 >whereis  locates source/binary and manuals sections for specified files.  The supplied names are first stripped of leading pathname components and any (single)
   trailing extension of the form .ext, for example, .c.  Prefixes of s.  resulting from use of source code control are also dealt with.  whereis then attempts to
   locate the desired program in a list of standard Linux places.

where目录:
/{bin,sbin,etc}
/usr/{lib,bin,old,new,local,games,include,etc,src,man,sbin, X386,TeX,g++-include}
/usr/local/{X386,TeX,X11,include,lib,man,etc,bin,games,emacs}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章