Is there a timeout for a batch file? - timeout

I am using a bat file on a Windows 2000 SP4 server to copy database files while the database is shut down. Once the bat file hits the xcopy command, it does the copy, but never returns to the bat file to continue with the other commands (start up the database, etc). I should mention that the xcopy takes several hours. Is there some sort of time out or time max with bat files? Is this normal? If so, is there any way around this?

Batch files don't timeout. It sounds like you might be running into a prompt from XCOPY, like an "Are you sure" prompt.
Make sure you've added the necessary command-line switches to XCOPY to make it silent.
The ones I'm aware of are:
-Y to suppress prompts about overwriting files
-C continue even if errors occur

Also, make sure that you are running the XCOPY.EXE app, and not finding an XCOPY.BAT file somewhere on your path. (calling a batch file from a batch file prevent returning, unless you use the CALL command)
And, be sure you are not overwriting the batch file itself during the XCOPY.

Presumably everything looks OK in your backup.log file?
It looks like you are redirecting STDOUT to your log file, but not STDERR - would suggest adding 2>&1 to the end of the command line to ensure you're not missing any error information from the log.

There's no timeout that I'm aware of on .bat or .cmd files. However, there may be on the process that's launching it? How are you launching it?

Related

perfino agent is not logging to a file even when i use the logfile directive

I do something like this
-javaagent:/usr/local/lib/perfino/perfino.jar=server=ybperfino,name=${HSTNAMESHORT}-${APPNAME},group=${YBENV}/${HSTNAMESHORT},logMBean=10,logFile=${LOG_DIR}/perfinologs/${HSTNAMESHORT}-${APPNAME}.log
basically I want the log files to be created in the log directory for the app not the home directory for the userid
but it seems like the log file isn't being created either with logfile argument or with out !
using java11 if that makes any difference.
Found the answer - I had a competing java agent that was loading before it.
After I changed the order both java agents worked.

Jenkins console output has an error with log permissions

My jenkins setup is not overly complicated, there are just a bit over 200 jobs; the problem I'm having is as follows:
The jobs folder is mounted on NFS drive;
Some of the jobs are creating log file fine, but then it is loosing permissions completely (it becomes 000), resulting in an error on the console regarding log file permissions:
I've checked and rechecked permissions on the folder and all the jobs, but nothing is there stands out that could explain what's the cause of the problem. It's not an issue on its own, but some of the jobs are quite important, and without manually fixing permissions, they can't be debugged.
Any hints would be welcome.
I had the same issue, it's more than likely that your version control (e.g Perforce/SVN) sets log files to read only permissions when synced.
An easy work around to this problem is to add an "Execute Windows Batch Command" build step where you cd into the directory containing your log file and change it's permissions.
Use the commands:
cd
attrib -r
This will alter the permissions of your log file and allow your jobs to write to the file. I'm sure there's other ways of dealing with this issue but this is a pretty quick and easy way.

conemu and console2 emulators not getting new path variable

I thought maybe it was a system issue but recently did a fresh install (win7 64bit) and a clean install of conemu (had same problem with both conemu and console2 on old win32 system). Also everything I find researching has to do with adding variables via the command line. I'm doing this through Start->Control Panel->System->Advanced System Settings and then restarting the console. cmd picks up the path correctly.
When I manually add a new path to the system or user PATH variable and then restart the console and echo %path% it has not re-loaded the new PATH variable.
cmd.exe:
C:\Users\lotus>echo %path%
C:\Python33\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\
System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\PHP;C:\ProgramData\
Composer\bin;C:\PHP;C:\PHP\ext;C:\Ruby200-x64\bin;C:\Users\lotus\AppData\Roaming
\npm
conemu:
C:\Program Files\ConEmu>echo %path%
C:\Program Files\ConEmu\ConEmu;C:\Program Files\ConEmu;C:\Python33\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Ruby200-x64\bin
I know there is a extra C:\PHP but that's another issue. I still have the same problem if I remove that.
Thanks
When you are using alternative tab based terminals like ConEmu or Console2, you need to restart the terminal, not a single console (read tab)!
This is because child processes inherit their environment their direct parent process, not from the system!
Sometimes explorer (or whatever shell you are using to start ConEmu) needs to be restarted, as in you have to kill explorer.exe, so your start menu disappears and relaunch it from task manager. If all else fails, log off and on again.
Even if ConEmu is closed, there is a ConEmu64.exe process. Need to kill it.

could not start the sphinx search service on local computer?

i am getting this
Windows could not start the SphinxSearch service on Local Computer.
Error 1067: The process terminated unexpectedly.
i got installation instruction from this .
http://blog.robbsnet.com/2011/07/how-to-install-and-implement-sphinx.html
build process is complete but when i start the sphinx search service i got errors .
Try running searchd manually from Command Prompt. Maybe it will give you a useful error message.
Try also looking in searchd.log
For anyone who is still having problems with the Windows service:
Make sure your configuration is correct for both database and paths and the needed folders & files are created.
Make sure that the service "command" matches the correct paths and files, to do so you have to:
Run administrative tools, click on local services, then find SphinxSearch. Click on its properties and read the line the service is trying to execute. If the configuration path doesn't match the service start command, it will fail to start.
FYI, this can also happen because your search data files are corrupt. Easy fix for that is to nuke the files and refill them.

Puppet Accidently deleted etckeeper-commit-pre and etckeeper-commit-post is there a way to regenerate these files?

Basically I deleted these files while doing some clean up in my puppet directory.
Now when I run #app: puppet apply /some/file I got an error stating these file where missing. (of course)
So I created two new files and I got this:
err: Could not run command from prerun_command: Execution of '/etc/puppet/etckeeper-commit-pre' returned 1:
err: Could not run command from postrun_command: Execution of '/etc/puppet/etckeeper-commit-post' returned 1
Any hints would be great thanks
Thanks
Anthony
If you have the Puppet "filebucket" enabled, you could look through the logs to find the hash of the removed file, then recover from that.
Otherwise go to your backups, or reinstall the package they come from.

Resources