特定のSQLをGAEのcronで定期実行させたいのですが、cron定義デプロイ時にエラーが出力されます
初回はデプロイ成功したのですが定義に不足があるため、SQLの実行は失敗
cronの定義を見直して修正と再デプロイを試みた結果、デプロイ失敗
cronの定義を元に戻してから、再デプロイをするも失敗している状況です
※デプロイ dwhtest01@cloudshell:~/cron (fluid-emissary-216806)$ gcloud app deploy cron.yaml gcloud app deploy cron.yaml ERROR: (gcloud.app.deploy) An error occurred while parsing file: [/home/dwhtest01/cron/cron.yaml] in "/home/dwhtest01/cron/cron.yaml", line 2, column 23 ※cron定義 dwhtest01@cloudshell:~/cron (fluid-emissary-216806)$ cat cron.yaml cron: -description: "test job" url: /home/dwhtest01/cron/bigquery_tbl_gousei.sql schedule: every 1 mins ※SQLの定義 dwhtest01@cloudshell:~/cron (fluid-emissary-216806)$ cat bigquery_tbl_gousei.sql insert into `fluid-emissary-216806.embulk_test.INPUT_TEST_003` (ID,NUM,STR,VARSTR,DT,TIME0,TIME6,TIME9) select * from `fluid-emissary-216806.embulk_test.INPUT_TEST_001` where Num in (select Num from `fluid-emissary-216806.embulk_test.INPUT_TEST_002` A where not exists(select 1 from `fluid-emissary-216806.embulk_test.INPUT_TEST003` B where A.NUM=B.NUM)); commit;
※2018/12/26
GAEのcloud shellからcrontablを使って、定義する方法を試しました。
実行されているか不明の状況です。
※※シスログ※※ dwhtest01@cloudshell:/var/log (fluid-emissary-216806)$ cat syslog | grep cron Dec 27 09:36:52 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 crontab[370]: (dwhtest01) BEGIN EDIT (dwhtest01) Dec 27 09:37:04 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 crontab[370]: (dwhtest01) END EDIT (dwhtest01) Dec 27 09:37:10 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 crontab[389]: (dwhtest01) BEGIN EDIT (dwhtest01) Dec 27 09:45:27 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 crontab[389]: (dwhtest01) END EDIT (dwhtest01) Dec 27 09:46:10 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 crontab[450]: (dwhtest01) LIST (dwhtest01) Dec 27 09:46:13 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 crontab[457]: (dwhtest01) BEGIN EDIT (dwhtest01) Dec 27 11:11:13 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 crontab[457]: (dwhtest01) REPLACE (dwhtest01) Dec 27 11:11:13 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 crontab[457]: (dwhtest01) END EDIT (dwhtest01) Dec 27 11:11:20 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 crontab[518]: (dwhtest01) LIST (dwhtest01) Dec 27 11:50:25 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 cron[1089]: (CRON) DEATH (can't open or create /var/run/crond.pid: Permission denied) Dec 27 11:50:35 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 cron[1134]: (CRON) INFO (pidfile fd = 3) Dec 27 11:50:35 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 cron[1135]: (CRON) STARTUP (fork ok) Dec 27 11:50:35 cs-6000-devshell-vm-b7ca3c5c-6e14-4b8f-91c9-233241f099b9 cron[1135]: (CRON) INFO (Running @reboot jobs) dwhtest01@cloudshell:/var/log (fluid-emissary-216806)$ ※※サービス状態※※ dwhtest01@cloudshell:/var/log (fluid-emissary-216806)$ service --status-all [ - ] apparmor [ + ] cgroupfs-mount [ + ] cron [ + ] docker [ ? ] hwclock.sh [ ? ] kmod [ ? ] lxc [ ? ] lxc-net [ - ] postgresql [ - ] procps [ + ] rsyslog [ + ] ssh [ - ] sudo [ - ] supervisor [ + ] udev [ - ] x11-common dwhtest01@cloudshell:/var/log (fluid-emissary-216806)$ ※※クーロン定義※※ dwhtest01@cloudshell:/var/log (fluid-emissary-216806)$ crontab -l # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use '*' in these fields (for 'any').# # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example, you can run a backup of all your user accounts # at 5 a.m every week with: # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ # # For more information see the manual pages of crontab(5) and cron(8) # # m h dom mon dow command 0 1 * * * /home/dwhtest01/cron/bigquery_tbl_gousei.sql dwhtest01@cloudshell:/var/log (fluid-emissary-216806)$

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/02/07 05:06