Batch file to flush redis client locally - batch-file

I want to flush redis server through batch file so I am trying to create batch file with following command but it doesn't work for me.
SET REDIS_PATH=C:\Redis
"%REDIS_PATH%\redis-cli" FLUSHALL

Solved My self. I have created a shortcut to desktop and edited properties.

Related

Run command in powercli using batch

I am planning to use batch file to run few commands in VMWare PowerCli tool. I am able to open Powercli tool by batch file. But after the tool is opened, it should automatically go to a specific folder and then run a file from that folder.
Eventually I would like this to add in Task scheduler so that it runs on specific time with no human interaction.
Is there a way to do it in batch or cmd? Any help is appreciated.
If I have read the question correctly you want to run a script on a VMWare VM using PowerCLI in which case you can use the invoke-vmscript command and set the scripttype to BAT
https://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/Invoke-VMScript.html
The batch file would change the location. Alternatively you can use the copy-vmguestfile command and copy the batch file over and just use the invoke-vmscript command to run that batch file.
If the eventual goal is to have start up run the file then use the copy command and use the invoke command to update registry keys regarding startup.
https://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.powercli.cmdletref.doc%2FCopy-VMGuestFile.html

How to execute batch file on server from my local computer?

What would be the best way to execute a specified batch script that are located on a server from my local machine?
I tried using PHP, and I had admin issues. I need something that can specify what batch needs execute, enter it then the batch file will get executed on my server.
Could you give some examples, or any site that works?
Thanks in advance! :)

Write a .bat script create database for orientdb and run by php

OrientDB is using console command create DB by the way run console.bat file on "..\orientdb\bin\". However i need create a .bat separate file run like this command:
create database remote:localhost/test <root> <password> local graph
And run that .bat file by PHP
Thank for advance !
Based on the old documentation at https://code.google.com/p/orient/wiki/ImportFromRDBMS it seem that it is possible and is similar to what i want to do as well.
console.bat database.sql
where all your sql commands are in database.sql. The link about includes a sample for porting a full database over but don;t see why it should not work for similar scripts as well.
That said i have not tested this yet.

Text File Permissions Issue

What is the default SSIS Account that is used in SSIS packages.
In one of my packages I have a Data Flow task that creates a flat file. A BAT file later runs and creates a file based on information in that .txt file. If I execute the .BAT in Windows Explorer it runs fine. When SSIS tries to execute it I can see the CMD window open and it tries to access the txt file and isnt able to. Says "Unable to access nameoffile.txt"
I assume the issue is that the permissions are probably inherited by the SSIS user account so I am trying to figure out which account that is.
If you are running it from the IDE then it uses your permissions. Most likely the problem is that your file is locked by some other process in your SSIS package. To verify:
Add a PAUSE to your batch file to make it wait for any key.
Run your package. While the dos prompt is waiting, go into windows explorer and run your batch file again - you'll find the same error.
I changed the attrib value in dos for that specific folder by attrib -r -s and it worked. It thought it was read-only.
I am using Windows Server 2012 server, with a SQL Server 2012 database.
Adding Modify, Read, Write permissions to the folder containing the required file to the NETWORK SERVICE user seems to work for me.

Log file locking issues in Batch scripting

I have a batch file which starts a Java server class. The output of the Java is redirected to a log file. This batch file is stared via a windows service. Problem is this log file is becoming very huge. Since the Java server is running, it is not possible to do any modification in the Log file as it is locked. How can I create a new log file for every day?
My idea was to write another batch file which will stop the service, backup the existing log file, delete and start the service file again. Is this approach correct?
java -Xms32m -Xmx256m gtServer >> abclog.txt
Above is the code in the batch file which starts the sever
Any tips on how we could back up the file without stopping the java server?
Thanks in advance
Karthik
Heard about log4j?
Ok, seriously, would it be possible to use some proper logging facility? It usually provides something for this purpose like RollingFileAppender.

Resources