crontab

Crontab wont run python script

为君一笑 提交于 2019-11-27 23:49:30
问题 When I execute my python script from the command line I have no problems like so: [rv@med240-183 db]$ python formatdb.py [rv@med240-183 db]$ When I try to use crontab to run the script every midnight I get a series of errors: import: unable to open X server `' @ import.c/ImportImageCommand/367. /home/rv/ncbi-blast-2.2.23+/db/formatdb.py: line 2: from: command not found /home/rv/ncbi-blast-2.2.23+/db/formatdb.py: line 3: from: command not found import: unable to open X server `' @ import.c

linux常见报错

烈酒焚心 提交于 2019-11-27 22:16:37
零.目录 一. 文件和目录类 File exist 文件已经存在 No such file or directory 没有这个文件或目录(这个东西不存在) command not found 命令找不到(没有这个命令) invalid option 无效的参数(不可用的参数) overwrite 覆盖 remove regular empty file 是否删除普通文件(空的)? is a directory xxx是一个目录 descend into directory 是否进入目录 Invalid level 无效的层数,层数必须大于0 Can't open file for writing 无法打开这个文件 No write since last change xx column window is too narrow 窗口只有xx列太窄了 无法完全显示 xxx not a directory 不是一个目录 查看压缩包的时候报错 You have mail in /var/spool/mail/root permission denied Warning: Changing a readonly file 'readonly' option is set (add ! to override) cp: omitting directory ‘/oldboy/’

AIX中crontab和at 定时任务

…衆ロ難τιáo~ 提交于 2019-11-27 20:46:23
1、crontab crontab文件用于在指定日期和时间周期性地执行作业 crontab 作业存放在/var/spool/cron/crontabs/$USER cron根据crontab文件项运行命令。如果用户不指定将cron作业的输出重定向到标准输出或标准错误。 cron将使用电子邮件向用户报告其输出或错误 要使用cron,用户必须建立crontab文件 cron进程将crontab文件驻留在内存中,所以用vi直接修改硬盘上的cron文件是没有效果的 必须使用crontab命令操作,它会告诉cron进程crontab文件已修改 语法: minute hour day month dayofweek command 分钟 小时 天数 月数 (0~6,0表示星期日) 示例1: 50 23 * * 6 /home/oracle/rman.sh 表示每月每天的23点50分,只要这一天星期六,就执行脚本 50:表示50分钟 23:23点 *:表示所有天 *:表示所有月 6:表示星期六 在AIX中,任务计划的使用授权控制在两个文件中: /var/adm/cron/cron.deny :定义了不允许使用cron的用户 /var/adm/cron/cron.allow :定义了允许使用c'ron的用户 如果两个文件都存在,那么只有cron.allow文件有效,如果两个文件都不存在

Set Interval in Node.js vs. Cron Job?

邮差的信 提交于 2019-11-27 20:32:36
问题 I'm learning node.js and just set up an empty Linux Virtual Machine and installed node. I'm running a function constantly every minute var request = require('request') var minutes = 1, the_interval = minutes * 60 * 1000 setInterval(function() { // Run code }) }, the_interval); And considering adding some other functions based on current time. - (e.g. run function if dateTime = Sunday at noon) My question is are there any disadvantages to running a set up like this compared to a traditional

Scrapy crawler in Cron job

微笑、不失礼 提交于 2019-11-27 20:21:43
问题 I want to execute my scrapy crawler from cron job . i create bash file getdata.sh where scrapy project is located with it's spiders #!/bin/bash cd /myfolder/crawlers/ scrapy crawl my_spider_name My crontab looks like this , I want to execute it in every 5 minute */5 * * * * sh /myfolder/crawlers/getdata.sh but it don't works , whats wrong , where is my error ? when I execute my bash file from terminal sh /myfolder/crawlers/getdata.sh it works fine 回答1: I solved this problem including PATH

How can you execute a Node.js script via a cron job?

眉间皱痕 提交于 2019-11-27 17:35:59
Quite simply, I have node script that I want to execute once a month. 30 6 1 * * node /home/steve/example/script.js But this doesn't work, presumably because of path or the shell the command is being ran under. I've tried the following means of executing node via cron (tested with -v): steve@atom:~$ node -v v0.4.2 steve@atom:~$ sh node -v sh: Can't open node steve@atom:~$ bash node -v /usr/local/bin/node: /usr/local/bin/node: cannot execute binary file steve@atom:~$ /usr/local/bin/node -v v0.4.2 steve@atom:~$ sh /usr/local/bin/node -v /usr/local/bin/node: 1: Syntax error: "(" unexpected steve

How do set cron to run my script every 40mins/25mins?

删除回忆录丶 提交于 2019-11-27 17:28:40
问题 I want a script to run every 40mins beginning on the 40th minute. so that means: 00:40, 01:20, 02:00, 02:40, 03:20... So I made this entry to cron: */40 * * * * /path/to/script/foo.sh Unfortunately this runs the script every 40th minute of the hour: 00:40, 01:40, 02:40... The same goes with the script that I meant to run every 25mins. Am I missing something here? ANSWERS Alright, in case you happen to drop by here having the same problem here's how I solved it: # 40mins-interval 40 0 * * *

Running a simple shell script as a cronjob

ε祈祈猫儿з 提交于 2019-11-27 17:26:02
问题 I have a very simple shell script I need to run as a cronjob but I can't get even the test scripts to run. Here's and example script: /home/myUser/scripts/test.sh #!/bin/bash touch file.txt crontab: * * * * * /home/myUser/scripts/test.sh The script runs fine from the terminal but can't get it to run as a cronjob. So far I've tried these in crontab: SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin * * * * * /bin/bash /home/myUser/scripts/test.sh And this in the

Running a cron job at 2:30 AM everyday

限于喜欢 提交于 2019-11-27 16:46:15
How to configure a cron job to run every night at 2:30? I know how to make it run at 2, but not 2:30. JoG crontab -e add: 30 2 * * * /your/command A.A To edit: crontab -e Add this command line: 30 2 * * * /your/command Crontab Format: MIN HOUR DOM MON DOW CMD Format Meanings and Allowed Value: MIN Minute field 0 to 59 HOUR Hour field 0 to 23 DOM Day of Month 1-31 MON Month field 1-12 DOW Day Of Week 0-6 CMD Command Any command to be executed. Restart cron with latest data: service crond restart fedorqui As seen in the other answers, the syntax to use is: 30 2 * * * /your/command # ^ ^ # | hour

How to run crontab job every week on Sunday

无人久伴 提交于 2019-11-27 16:39:16
I'm trying to figure out how to run a crontab job every week on Sunday. I think the following should work, but I'm not sure if I understand correctly. Is the following correct? 5 8 * * 6 Bjoern Rennhak Here is an explanation of the crontab format. # 1. Entry: Minute when the process will be started [0-60] # 2. Entry: Hour when the process will be started [0-23] # 3. Entry: Day of the month when the process will be started [1-28/29/30/31] # 4. Entry: Month of the year when the process will be started [1-12] # 5. Entry: Weekday when the process will be started [0-6] [0 is Sunday] # # all x min =