我添加了一个像这样的crontab:
banner_url = JSON.parse(image_insert_response.body)["url"]
channel_list_res["items"][0]["brandingSettings"]["image"]["bannerExternalUrl"] = []
channel_brandingSettings = channel_list_res["items"][0]["brandingSettings"]
channel_brandingSettings["image"]["bannerExternalUrl"] = banner_url
channels_update_response = client.execute!(
:api_method => youtube.channels.update,
:parameters => {
:part => 'brandingSettings',
},
:body => {
:brandingSettings => channel_brandingSettings,
:id => channel_list_res['items'][0]['id']
})
然而,它运行了两次。而且,我们可以看到/ var / log / cron中记录了两个日志:
Jun 30 20:00:01 demo1.ops.dev CROND [29181] :( root)CMD(/home/test/a.py)
Jun 30 20:00:01 demo1.ops.dev CROND [29180] :( root)CMD(/ usr / lib64 / sa / sa1 1 1)
Jun 30 20:00:01 demo1.ops.dev CROND [29189] :( root)CMD(/ usr / lib64 / sa / sa1 1 1)
Jun 30 20:00:01 demo1.ops.dev CROND [29190] :( root)CMD(/home/test/a.py)
答案 0 :(得分:0)
自己回答,