 |
hiteksoftware.com User discussion forum
|
View previous topic :: View next topic |
Author |
Message |
melvin Site Admin
Joined: 25 May 2006 Posts: 635 Location: Santa Barbara, california
|
Posted: Tue Mar 19, 2013 7:18 pm Post subject: SFtp download triggers Database stored procedure. |
|
|
User support Request:
Here is the scenario. We have a remote server where new files are added on a daily basis every hour between 07:00 and 20:00. The file name format is filename-mmddyy_hh_00.dat. ie file-031913_08_00.dat.
I need a process that will check each hour and down load the new file if there is one , rename it on the local server, make a copy and then trigger a stored procedure to update the sqlserver database. If there is not a new file then the process does not need to do anything. If there is an error I need the process to send me an email. This has to be an sftp-ssh process. I have already connected to the remote server using your sftp process. |
|
Back to top |
|
 |
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Thu Mar 21, 2013 11:39 am Post subject: |
|
|
Create a new ‘Task Sequence’ with following steps:
Step 1 – SFTP download task (new task button / SFTP/SSH2 folder / Maverick / SFTP task)
Filename field = file-$%DATE::ppddyy_hh%$_00.dat
Step options: if exit code ==0 , go to step 100 (i.e. exit the task sequence) .
In the SFTP task , if files are transferred, then exit code = –100 . No error and no files transferred , exit code = 0. If error , exit code > 0.
In the SFTP task you can rename the local file during the transfer, as well as backup to another local directory. (i.e. 2 local files) . If you let us know exactly what you need to rename to , we can help you with this.
Step 2 – Create Database Stored Procedure task. (new task button / Database / Database SQL )
Email Notification:
Step 1: Settings / Email profiles. Create an email profile and test that it sends you an email.
Step 2: Settings / Email notification. Create an email notification with following settings:
Profile name = task_failure
Task List : All_Tasks
select option “send email if task exit code > 0”
fill out the rest..
This will send you email if any task fails (exit code > 0) |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|