rhc app create cht php-5.3
rhc cartridge add cron -a cht
rhc ssh cht
cd ~/app-root/runtime/repo/.openshift/cron/minutely/
cat >ticktock
#!/bin/bash
date >> ${OPENSHIFT_PHP_LOG_DIR}/ticktock.log
chmod +x ticktock
echo ${OPENSHIFT_PHP_LOG_DIR}
[cht-0102734.rhcloud.com logs]\> echo ${OPENSHIFT_PHP_LOG_DIR}
/var/lib/openshift/551c24a7e0b8cd86a3000162/app-root/logs/
[cht-0102734.rhcloud.com logs]\>
rhc cartridge add https://raw.githubusercontent.com/daniel-sc/casperjs-cartridge/master/metadata/manifest.yml -a cht
${OPENSHIFT_CASPERJS_BIN_DIR}/casperjs --version
${PHANTOMJS_EXECUTABLE} -v
curl http://some.testserver.com/post.php \
-F file_input=@/path/to/my/file.txt \
-F "text_field=Some Text Here" \
-F some_number=1234
You can however open a POST request on casperjs:
casper.start();
casper.open('http://some.testserver.com/post.php', {
method: 'post',
data: {
'title': 'Plop',
'body': 'Wow.'
},
headers: {
'Content-type': 'multipart/form-data'
}
});
casper.then(function() {
this.echo('POSTED it.');
});
casper.run();
------------------------------------
[xxx.rhcloud.com selfcall]\> cat selfcall.js
//변수선언하기
var casper = require('casper').create();
var url='http://xxx.rhcloud.com/';
casper.start(url);
casper.then(function() {
console.log('selfcall');
});
casper.run();
[xxx.rhcloud.com selfcall]\>
[xxx.rhcloud.com selfcall]\> cat selfcall.sh
#!/bin/bash
## 1. path setting
export PATH=${OPENSHIFT_CASPERJS_BIN_DIR}/:${PHANTOMJS_EXECUTABLE}/bin/:$PATH
## 2. capture Site
casperjs ~/casperjs/CRONTAB/selfcall/selfcall.js
## 5. end
[xxx.rhcloud.com selfcall]\>
'Tool > openshift' 카테고리의 다른 글
rhc client (0) | 2020.04.21 |
---|---|
openshift / SuiteCRM / opensource CRM (0) | 2020.04.21 |
openshift / wordpress backup (0) | 2020.04.21 |
openshift / wordpress / domain (0) | 2020.04.20 |
Deploy war application on OpenShift (0) | 2020.04.20 |