I need to run an rsync command from inside a Laravel 5.2 console command, this may seem pretty obvious, but how can I do that?
The idea is to connect to one of my servers and get a copy of a directory and save it locally in my laravel storage directory.
I want it on a console command because I want to schedule it to run daily.
Thanks to the guys over at Laracasts, there was a simple solutions to this.
You just put the command inside exec() function.
https://laracasts.com/discuss/channels/laravel/how-to-run-an-rsync-command-inside-a-laravel-console-command
Related
I have installed postgreSQL multiple times because I did not know better in the past, and now I am having trouble running SQL shell (psql) on my desktop.
It would not let me log in, would not tell me all the versions that I have installed, would not let me change supervisor user.
However, I really need to find a way to run my SQL commands and output script style result (like the analog format you would get on SQL shell) in order to complete my homework.
I have already checked the results of my commands on pgadmin 4 on my browser, so I just have to run it and get script style output.
Do any of you know an online SQL shell that I can use?
Thank you.
I have implemented a javascript script for my mongo database. This script is called getMetrics.js and I am able to execute it by running: mongo getMetrics.js from my computer.
Now I want to automatically execute that script one time per day. To do so, I have created a Heroku app and I added to it the scheduler add-on (https://devcenter.heroku.com/articles/scheduler).
My main problem is that in order to be run, my task will execute the command "mongo getMetrics.js" and it will failed because I don't have mongo command installed in my Heroku app.
How can I run this script from Heroku?
Thanks a lot for your help.
I did the below in a similar case:
Download mongodb for linux https://www.mongodb.com/download-center#community
The bin folder contains the mongo binary
Make this binary available in your Heroku instance (e.g. If you have your Heroku configured with your git repo, then checkin this binary along side your script
[Make sure the folder you are keeping this binary is in the path, safe path will be inside /bin]
i am trying to install jboss-fuse-6.1.0.redhat-379
and i am able to create esb:create-admin-user via console but not i am trying to automate installation via shell script .
i am able to start fuse server but not able to create user
esb:create-admin-user.
below is sample script for creating user.
!/bin/ksh
cd $HOME/jboss-fuse-6.1.0.redhat-379/bin
./fuse esb:create-admin-user --new-user admin1 --new-user-password admin12
but it is not creating user.
please let me know how i can do this .
This could be the issue with file write access present in etc .
Here is the another solution for that
Go to jboss-fuse-6.1.0.redhat-379/etc folder
Open users.properties file and add username=password,admin
Last word admin is the "Admin" role.
You are probably looking for the bin/client script to execute commands against a running fuse instance. But for that you will need a username/password ;)
If you want to automate it is indeed probably easier just to use #mahesh-biradar approach:
echo "admin1=admin12,admin" >> etc/users.properties
I am trying to run a meteor app for the first time on Windows( using Windows 7 in particular). I am able to successfully run the app but i can't seem to be able to run the command meteor mongo in a separate command prompt window. The following error pops up:
mongo: Meteor isn't running.
This command only works while Meteor is locally. Start your
application first.
I have already tried meteor reset. How can i fix this?
I think there is possible a misconception about what the meteor mongo command does.
It only connects to the mongo instance of a running meteor development process.
So you need to start the meteor app by changing to your app's directory and running 'meteor'. Then on a different console window, change you the same directory and run 'meteor mongo'.
In the image below, when meteor isn't running I get the error you get, but you will note that it says that you have to start your application first. If you do that, and then in another console window it works:
Try one of these admin UIs for mongo instead. They connect directly to the db, so should overcome whatever problem there is with command line.
Alternatively, you may try a non-standard command line utility, like Cygwin.
I am trying to access an Oracle ILOM interface via command line to read the event log.
As far as I know there are several ways to do this, but none work for me and my environment:
IPMItools: seems to be available only for Linux or on the CD/DVD that originally came with the server, which of course was lost;
SSH access (via putty) works fine, but I could not figure a way to automate logging in, running a command on the remote server and reading the result (still looking into it);
command line SSH access via plink works fine, but as soon as I try adding a command to run on the server (e.g. plink.exe -l root -pw password FQDN help) I get the error message "shell: Invalid credentials". adding the -t option did not change anything;
the SSH.NET library for powershell fails with the following exception "Exception calling "Connect" with "0" argument(s): "No suitable authentication method found to complete authentication". Documentation suggests adding a generated public RSA key to the server to allow for possword-less login. That cannot be done on Sun ILOMs;
Connecting via a serial port as detailed here does not work for me. I must be missing something from the posted code, but I simply cannot open a connection.
Has anyone ever tried to access an ILOM from command line? Could anyone offer a pointer as to what might work?
Ideally I'd like to automate this in a powershell script to be run from a Windows machine, but I'm open to any suggestions that do not require Visual Studio to implement.
Any help would be greatly appreciated!
ipmi and ssh remote command only supports in ilom3.0+.
if you are using alom, ilom2.0, or sxcf, you won't be able to use these tools.
I'd recommand to use python with pexpect https://pexpect.readthedocs.io/en/stable/.
check my snippet https://gist.github.com/happlebao/ca143cf3feaf60ca8ef75f7a66cf8a8a