Run perl script on amazon ec2 - database

I need to run a Perl Script on my EC2 instance. This script will download files from an FTP client and then upload the data to the RDS database on the EC2 instance. The script needs to run everyday at a specific time. For now, i have the script on the local machine and it does work. But is there a way to upload the script itself on ec2 so the script will run there and my PC need not be running.

Yes you can do this. Just run the script as a cron job and give all the environment dependencies to run the script on ec2 instance. Running the job on an ec2 instance will not be different from running your job on the local box if the environment is setup properly.

If you are using windows, then you can use Bitvise Tunnelier to upload your script to ec2 instance. After this, you can set your script in cron job to run everyday.

Related

Azure Devops deploying web app to a server - how to also update database

We have a web app which due to budgetary reasons is running on a windows VM (IIS) with its database also running in SQL Server on the same server.
We have a build pipeline set up in Azure Devops which builds the web app and then creates an idempotent SQL migration file (We use Entity Framework), both the compiled app and the SQL file are copied into the build artefact.
We then have a release pipeline which deploys the web app into IIS on the server.
What I cant figure out is how to get the SQL file run into the database.
I have tried the "SQL Database Deploy" task but that seems to only want a .dacpac file, or the path of a SQL file which is already on the server - I dont seem to be able to give it a file that exists on the build machine to execute remotely.
I know that because we are using EF I could just make the application do its migrations on startup but that means that the app needs to run as a user with schema privileges which we don't really want, currently the app is only a data reader/writer.
Is there some mechanism that I can take the SQL script from the build artefact and run it on the remote VM? If not, what are my options for getting the file onto the VM so that I can run it using the "SQL Database Deploy" task? I don't want to deploy it with the web app as although its a small risk we don't want it lingering in a public folder.
Any help appreciated.

Run SSIS/SSDT on app server

My company is insisting that we not run SSIS/SSDT jobs on the DB server, but instead run them on an app server and since they're not offering any assistance how this possible I'm trying come up with ways to do it. Here are my ideas so far, but would like to know of any approaches tried that work.
Install SSDT2013 on the app server and use the 32bit db it creates to
schedule and run jobs on the DB server
Use VBS (scripts) to launch the packages
Use DMO to launch jobs
Ideas?
If they want them to run on the app server then they will need to buy a SQL license for it.
Start there and see if they will run them on the db server!

AWS EC2 Linux take iOS client command to execute python script to query database in RDS

I currently have an EC2 Amazon linux instance running, I have some python scripts I have created and stored in my cgi-bin. I am having my iOS client (iPhone app) make an http request to execute the python scripts located in the cgi-bin directory of my EC2 instance, which then the script makes a request or insert into my MariaDB which is hosted on a remote database server by the RDS service provided by amazon.
Is this a safe practice method to execute commands? I want to know whats the best way to make calls into the RDS database from the EC2 instance that gets triggered by a python script which is called from an iOS device. Should I take a different approach?
The security of your RDS database is dependent on the security of your python script. If you have configured your EC2 and RDS instances correctly they should be in the same VPN and your RDS instance should not be exposed outside of the VPN.

PowerShell AD on server or desktop?

I'm starting out on creating PowerShell scripts for my company. I'm new the the platform and I plan on creating scripts for AD tasks
If im creating scripts for AD should I be able to run the script on any machine in the domain or does the script have to be run on a machine that is the active directory server?
I don't mind running the script on the server but for testing and creating I would rather run it on my desktop for development and testing
any incite on this?
Assuming you're using the activedirectory powershell module, then the only requirement is that the machine you're running the script on has this module installed.
This module is a windows feature "Remote Server Administration Tools > Role Administration Tools > AD DS and AD LDS Tool > Active Directory Module for Windows Powershell."
On a server OS, this can be simply added as a feature through Server Manager
On a client OS, you will first need to install the Remote Server Administration Tools (RSAT) from Microsoft download centre. Once that is installed, you then install the feature through "Turn Windows Features on or off"
Additionally, if your script has a dependency on this module, you can also place the following line at the top of your script
#Requires -Module activedirectory
Then if you try to run this script on a machine without the activedirectory module, it'll produce an error saying the module is missing. It'll also cause the activedirectory module to be imported if it's not already been imported which is useful on powershell. Refer to about_Requires for more information on the #Requires statement

SQL Agent Run SSIS package as Administrator

I'm trying to run a SQL Agent Job with a step that is a SSIS File, and I need this step to be run as administrator.
My Package uses a Script task to download a file, as a Browser i Use WATIN.
I'm using a thread to start this browser because this browser control requires the thread to be set as Single-Threaded Apartment.
This browser control is requiring to be run as administrator.
I've already created a Credential for a user that is Windows Admin, a Proxy SSIS account. (SQL Agent user is not windows admin).
But the SSIS package is not run as administrator yet.
I'm suspecting this is related to UAC.
Some details:
SQL Agent Account is not Windows Administrator
Using Windows Server 2008 R2
My Package is run from the File System.
The Package only works on BIDS if I run it as an Administrator (if not admin doesn't work)
The Proxy account the job step is configured to run is windows admin.
Any help is appreciated!
Take a look at SSIS runs in BIDS but not with SQL Agent for some ideas
I've solved this in another way, The problem wasn't related to running the package as administrator, but creating a windows and setting focus to it, however I had the option to see the result file on the web page and I managed to use it, without downloading it, thus not needing to set focus on the download windows.
Thanks for all the help.
Try to add the user account in SSIS administrator group which can solve your problem.

Resources