Author |
Topic |
satya068
Posting Yak Master
233 Posts |
Posted - 2010-09-15 : 11:07:32
|
Hello friends,i am not sure whether this is wright place of posting my query.Every day 70 txt files comes into my server,this will be replaced with new text files the next day.If my job fails i dont have any back-up storage of these files.i am palnnning to create a back-up everyday for 40 txt files out of 70 and want to store in same location with folder naming with BACK-UP_TXT_FILES.Guys,could you please let me know your ideas?Thanx in Advance.Satya |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-09-15 : 11:22:19
|
I'd set up a job to1. Copy the files to a new location2. Import the files3. If import suceeds, delete the copied files4. If it fails, send you an email and page youThis buys you an extra day to resolve any issues if the import fails.Even better, keep a few days (maybe a weeks worth) before deleting the copies. |
 |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-09-15 : 11:35:35
|
Thanx for ur reply,At the movement these files download into the server on a nightly basis,current day files will be saved and previous day files will be deleted automatically.Is ther any script to populate these files into new location before deleting.Satya |
 |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-09-15 : 12:05:19
|
can use windows copy (or xcopy) command. or robocopy. |
 |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-09-15 : 17:34:53
|
thanx russel,i am looking for a script that can do automatically every day after the downloading of txt files finishes,insetad of copying them manually.Satya |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2010-09-15 : 18:21:52
|
exactly. make the step type Operating System Command. then just xcopy *.txt to the destination directory |
 |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-09-15 : 18:39:07
|
Hi thanx both of u,i think if i use that script all the files will be copied,is their any way other way to copy the selected txt files into new location instead of copying the complete files in the folder.i need only 40 files out of 70txt files.Thanx in advance.Satya |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-09-15 : 18:57:55
|
i got the list for the 40 files that need to back-up every day,becaz rest 30 are bulk files which are downloading every day.my job is to skip bulk files and copy only ref txt files into back-up folder.programmatically no idea , how to perform this task,looking for ideas from experts.Satya |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-09-15 : 19:34:11
|
all txt file name ends with _DATA_DAY.Txti have the below codeexec('cmd','copy D:\\Daily_Load\\'|| 'FILE_* D:\Daily_Load_back-up\\Archive',8);i am trying to find more efficient code for taking back-up.Satya |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-09-15 : 19:46:32
|
thanx for ur help,any way ill have a try with ur code.with my code i can only do that with in my DI job.Satya |
 |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-09-16 : 05:35:14
|
hi,when i used the below code in my job xcopy R:\\ARI-DI-BO1\DATA_DAY\\ALERTS_DATA_DAY.Txt R:\\ARI-DI-BO1\DATA_DAY_ARCHIVEit throwing an error message[Script:Initialise] (Ln 39) : Syntax error : near <R> found <IF> expecting <'(', '.'>Guys,could you please if any changes required to the code.Satya |
 |
|
tosscrosby
Aged Yak Warrior
676 Posts |
Posted - 2010-09-16 : 09:50:18
|
It appears your path is incorrect. You're mixing a fixed drive (R:) and a network path name (\\ARI-DI-BOI...). It should be one or the other. I use network paths whenever possible as drive letters can/will change depending on which machine it executes from.Terry-- -- Everyone is entitled to be stupid, but some abuse the privilege. |
 |
|
satya068
Posting Yak Master
233 Posts |
Posted - 2010-09-16 : 10:30:36
|
Hi..thanx to ur reply,Now iam able to archive the file with this code exec( 'cmd','copy \\\\emp_di_go1\\Reality\\DATA_DAY\SAL_DATA_DAY.TXT \\\\emp_di_go1\\Reality\\DATA_DAY_BACK_UP', 8 ); after copying the txt file into back-up folder i would like to rename with date extension(ex:SAL_DATA_DAY.TXT16092010)and for every month it should automaticallycreate a sub folder with that month name and all files should store in that month folder with date extension,this will be easy to trace the file. could this possible?if possible what code should i add to my exec. Thanx in advance.Satya |
 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|