Adding cron job in openshift without using git - openshift

I have added my webpage contents to /var/lib/openshift/XXXXXXXXXXXXXXXXXXXXX/app-root/runtime/dependencies/jbossews/webapps/ directory and I can see my webpage.
I have not used git repository.
I tried adding one shell script under /var/lib/openshift/XXXXXXXXXXXXXXXXXXXXX/app-root/runtime/repo/.openshift/cron/hourly directly. I dont see the script running.
I feel it has to be pushed to some service. Can this be done without git at all?
Adding example:
I have not created a git repository.
I have a index.html with just some header and body placed under /var/lib/openshift/XXXXXXXXXXXXXXXXXXXXX/app-root/runtime/dependencies/jbossews/webapps/test/.
Now I can access the website like www.test-rhtest.rhcloud.com/test/index.html
Now I have a shell script say test.sh. It is as below.
#!/bin/bash
echo date >> $HOME/app-deployments/temp.txt
I execute the script test.sh and it creates the file there $HOME/app-deployments/temp.txt.
Now I have placed the file under /var/lib/openshift/XXXXXXXXXXXXXXXXXXXXX/app-root/runtime/repo/.openshift/cron/hourly. I waited for hours to see execution, but no luck.
How should I enable this cron now?

The file SHOULD run, but you have to make sure that you made it executable (chmod +x) on the server. Also, make sure you can run it manually without getting any errors. Also, it seems you should put it into your ~/app-root/repo/... directory, instead of the runtime one.

Related

Sharing downloaded file between steps on github actions

I am downloading a file from AWS S3 in a github action. In the next step (same job) I am trying to edit the file. Sometimes the file is still there, and sometimes it isn't.
Each step runs a bash script, and I check at the end of the first step that the file exists. The file is being downloaded to the $HOME directory, so the path to the file is /home/runner/my-file.json
Where should I download the file to, to guarantee that it is still there on the next step?
Just to close this off, files downloaded to $HOME are persisted between actions in the same job. I finally realised that the next step is trying to edit the file twice concurrently (I'm using some lerna scripts) and that is why it was sometimes reported as empty.
Unfortunately, you can't keep this file after finishing the action running, so to solve this, You should push this file to the repo where this action is currently running on, this could be done through git commands.
Thanks

How to get AWStats to generate static HTML files?

I want to get AWStats running on my webserver that runs Debian 4.4.5-8 with Apache 2.
There are several websites that all have their own configuration file, similar to this:
Include "/etc/awstats/awstats.model.conf"
LogFile="/var/customers/logs/myname-example.com-access.log"
LogType=W
LogFormat = 1
LogSeparator=" "
SiteDomain="example.com"
HostAliases="*.example.com"
DirData="/www/myname/awstats/example.com/"
What I expect is that HTML files are written to /www/myname/awstats/example.com/ which I can then access through Apache. However when I run /usr/share/awstats/tools/buildstatic.sh what happens is that .txt files are written to that directory and HTML files that I want are written to /var/cache/awstats. The error file in /tmp remains empty.
Why is this happening and how do I make it work the way I want?
DirData is not supposed to be read directly by the Web Server. It is used by awstats.pl.
The fact is that /var/cache/awstats is hardcoded in buildstatic.sh so you have to change the two lines mentioning it:
mkdir -p /var/cache/awstats/$c/$Y/$m/
and
-dir=/var/cache/awstats/$c/$Y/$m/ >$TMPFILE 2>&1

How do I run a TCL script on files from my file manager?

I'm working on a simple TCL script that makes a few Tk dialogs appear and then compresses a file given by argv. It works just fine from the terminal by running "./script file", but since it's a graphical wrapper for a command-line utility, I want it to run from the right-click menu in a file manager.
I copied it to /usr/bin and used Caja's "Open With Other Application..." option on a random file (no spaces in the path), and entered the name of my script as the application to use. When I tried to open the file this way, there were no dialogs and no archive.
However when I tried to run the script from the terminal again, without the "./", it still worked.
What needs to be done to run a TCL script on a file from the right-click menu and still be platform independant?
Maybe you could start with determining wether Tcl or the file manager is the problem. Write a shell script...
#!/bin/sh
exec rm -- "$#"
...make it executable with chmod +x and try to use it as an "other application" on a file you don't care about. If the file isn't erased, Tcl isn't to blaim.
I have fixed the script in question. I don't know why the dialogs broke or why they are working now, but the archive was apparently failing to appear because the script's working directory was automatically set to my home folder by the file manager.
The code below is what I used to direct my script to the right folder. It changes the working directory to the one containing the file that the script is being run on.
cd [file dirname $argv]
Once I set that, most of my issues seemed to be resolved, and I can now continue dveloping my script.

Hudson bAt Script and Network drives

I build my little project with Hudson and would like to publish it on my network drive.
To do this, I wrote a little script which is executed after the build process:
xcopy .\Installer\bin\Release\*.* "M:\installerRelease" /I /E /Y
I tested it out of the working folder of hudson in the command line prompt and everything works great. After I put the code into Hudson and perform a build, Hudson says that everything works out well. So I take a look to my M drive but nothing's there. But the build log tells me that all the files were copied.
Is Hudson not able to write to the Netdrive?
I solved the Problem:
You need to use the server URl ...
Like:
//Server/installerRelease

How can I run hg commands in the background (without showing the command prompt window)?

I am using firefox extension to run hg commands on my repository. But when ever I execute any hg commands it shows command prompt window for a split second and closes it.
Eg:-
process.run("push");
process.run("update");
Is there any way to not show that window at all ?
Back in the day I used to have a tool that was hidewin.exe that would all you to start any bat file or exe file and have it run invisibly. I tried a google search for it but didn't find it easily but maybe you could have better luck at finding it.