Append an existing file?

Hello world,
I'm stuck in a predicament: The storage guys have asked me to reduce the frequency of backups on three of our instances to save bandwidth on the WAN when the backup files are copied across to another datacenter. The application owners do not want to backup
any less frequently. 
We do daily full backups and Tr-log backups every 15 minutes throughout the day.
Storage have advised that the SAN only copies changes (ie new files or the changes to existing ones)
Is it possible/ would it be of any benefit, to backup and append an existing file? Can I do this with the logs as with the databases?
Thanks in advance

Storage have advised that the SAN only copies changes (ie new files or the changes to existing ones)
I am not very sure that it will pick changes from existing ones, I think if it sees the file is changed it will start coping as 1 big file and will not solve your purpose. You might get it reconfirm with storage on this. Also even if it does like you said
I wonder if next backup runs and file is still getting copied over then backup will start failing saying "file is in use".
If application owner is saying 15 min log backup then we cant reduce the frequency, but if you have some other drive/disk where you can divert tlog backup say for 2 hours then you can run differential backup every 2 hour which goes to SAN. You will be safe
even if something happen you have tlog on 1 drive and
differential get copied to other datacenter. (But point in time recovery will be issue as you will not have any tlog backups for restore)
I cant think of anything else to reduce frequency, but for bandwidth see if you can use compress(enterprise edition) or zip backup file to save bandwidth.

Similar Messages

  • Write to text file. Append to existing file. Create file if file doesn't exist.

    Hi folks,
    up to LabVIEW 7 there was a wonderful "Write to Text File" vi which allowed the option "Append to File". Now, in LabVIEW 8, this old vi is not longer supported anymore. Instead, I am suggested to use a new "Write to Text File" vi. This vi does not offer the option "Append to File" anymore. Rather it is proposed in the online help that one should use the "Set File Position" in order to append text to the file. This much less straightforward than the old solution. Furthermore, I miss an option which would create the complete path if it doesn't exist yet.
    To summarize: Isn't there really any smart "Write to Text File" vi available which offers both the options "Append" and "Create path if file does not yet exist". Of course, I could write such a file on my own but I am sure that it is of such general interest that it already exist. In any situation, when a log file shall be written, the wanted vi would be ideal.
    Thanks a lot,
    Peter

    Ray,
    I know that the old vi is still available. See the screenshot which I attach to this message. What I am missing is an option "Create file or even complete path if file or path do not yet exist.". Is there any reason why NI doesn't provide neither this option nor a simple "Append to file" functionality in the new "Write to Text File" vi?
    Regards,
    Peter
    Attachments:
    Clipboard01.png ‏7 KB

  • How to append contents to an existing file contents at the end of file?

    Hi all
    I am Kiran, working with LV8.0  FDS
    I find difficulty while trying to add new file contents(some messages)  to an existing file at the end /begining of a file.
    Whenever i try to do that,it is replacing the previous contents,but i dont need that. i want the contents to be appended.
    Plz suggest me.
    thanks & regards
           kiran

    Hi Kiran,
    yes, I can attach a screenshot
    (open file, set file position to end, write text, close file)
    Message Edited by GerdW on 08-16-2007 03:19 PM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    append.png ‏2 KB

  • Can Acrobat Standard append to an existing file when saving?  Can Pro?

    Hello all,
    I'm wondering if Adobe Acrobat Standard has the function to save to an existing file. I don't mean append two PDF's together after they are already created. I mean I already have a PDF document which I need to add lots of additional pages to. So when creating additional PDF's, I want to be able to tell Acrobat to add those files to the end of the document I already have.
    PrimoPDF has this feature which would be a real time-saver in my line of business. In that program, you simply choose the same filename when asked to save the document. It then prompts you to overwrite or append-to the existing file. For business reasons, it would be very advantageous to use Acrobat rather than Primo. Does anyone know if Acrobat Standard can do this? If not, does Pro do it? Thanks for your time. I appreciate any feedback I get.
    Chris

    Never tried that... you might read in the Acrobat Pro User Guide Online
    http://www.adobe.com/support/documentation/en/acrobatpro/

  • Append stream object to existing file

    Hello, I'm trying to append a live stream to an existing file, but I cant figure out how to open the existing file and then append the live stream. This is server side as well.
    I know I need to open the existing file using stream = stream.get("file"). but I don't understand how to associate stream with the live stream coming in.
    PLEASE HELP~!!!

    This is what I have now, and it still overwrites :*(
    application.onPublish = function (p_c, p_stream)
        //check for the file helpers   
        filePath = new File("/streams/_definst_/");                             
        fileName = p_stream.name + ".flv";
        fileTest = filePath.fileName;     
        if (fileTest.exists == false){
            p_stream.record();
        } else {                
            mynewstream = Stream.get(p_stream.name); 
            mynewstream.onStatus = function(info){
                 trace(info.code);
            mynewstream.record("append"); 
            mynewstream.play(p_stream.name ,-1,-1,true);   //where livestream in name of stream getting published.

  • Appending to a file

    Can someone please let me know the reason(s) why appending data to an existing file only works with TEXT file and It does not work for MS word decoment or MS Excel file ?
    Is there another way ( Methods ) to append to these type of files than RandomAccessFile or ByteBuffer methods
    Thanks in advance
    IB

    For example, maybe the Word format looks like this:
    First 256 bytes: a directory listing
    Bytes 257 to N (as defined by directory): textual data
    Bytes N to M (again defined by directory): local dictionaries or other support data
    Bytes M to end: undo information, in a stack structure.
    And each of those subsections have their own format with their own intricacies.
    If that were the format, adding more data to the end wouldn't do anything other than corrupt the file.
    I don't know if it's the actual format...I'm sure it's not...but I'll bet there are some similarities and it's closer to that than to a plain text file.

  • Getting error when trying to append to existing pdf.

    Hello.  I am using Acrobat 9 Pro to save emails.  When using Internet Explorer, I press print and when the document print window opens up I right click on the document and select "Append to existing PDF" or "Convert to Adobe PDF."  This used to work for me.  Now all I get is an error message "An error has occurred in the script on this page" with "res://C:\Program Files(x86)/Common Files/Adobe/Acrobat/ActiveX/AcroIEFavClient.dll/AcroIEAppend.html."  It doesn't matter if I select yes of no to the message "do you wish to continue running script" question.  It just closes the window and does nothing.
    I am running Acrobat 9 Pro, Windows 7 Professional (64) Service Pack 1, Internet Explorer 9.  I also have Acrobat Reader X on my computer.  I think it was automatically installed before I put Acrobat 9 Pro on.

    You don't mention which version of Acrobat, but I doubt it is fully compatible with MSIE 9 which was released after Acrobat X no less Acrobat 9. Adobe doesn't support anything but Reader X with Acrobat X. Any other combination of Reader with Acrobat is known to cause problems. So you have two avenues to explore. First uninstall Reader X and then re-install Acrobat 9. Then upgrade to Acrobat 9.4.5. See if everything works ok. You may be good to go. If it still doesn't work, then you may have a compatibility issue between Acrobat 9 and MSIE 9. Maybe if someone is running that combination successfully, they can chime in here.

  • Unable to insert properly the text in a already existing file

    Hi Everyone,
    I am trying to read and write the text file using randomaccess class.
    When i am trying to update a line with string its over writing next line with the same number of bytes as my string which i am trying to insert.
    For example if my text file has following data
    test
    most
    must
    if i try to insert "text" after "test" the program overwriting the "most" word.
    if anyone can help that will be great. thanks in advance. Below is the code:
    RandomAccessFile raf = new RandomAccessFile(aFile, "rw");
    long len1 = raf.length();
    long off1 = 0;
    String line1;
    boolean updated = false;
    while ((line1 = raf.readLine()) != null)
    int coma;
    if ((coma = line1.indexOf(",")) != -1)
    String s = line1.substring(0, coma);
    if (s.equals(str))
    line1.indexOf(",", coma);
    StringBuffer nStr = new StringBuffer();
    nStr.append(line1);
    nStr.append(",");
    nStr.append(str1);
    nStr.append(System.getProperty("line.separator"));
    raf.seek(off1);
    raf.writeBytes(nStr.toString());
    raf.close();

    You can't insert data that way. You are always going to be overwriting data (unless you go past the end of the existing file, in which case you are going to be appending data).
    If you want to insert data, here's what you have to do:
    1. Write the data before the insertion point to a new file.
    2. Write the data you want to insert to that new file.
    3. Write the data after the insertion point to a new file.
    4. Close the new file.
    5. Delete the old file.
    6. Rename the new file.

  • How to read appended objects from file with ObjectInputStream?

    Hi to everyone. I'm new to Java so my question may look really stupid to most of you but I couldn't fined a solution by myself... I wanted to make an application, something like address book that is storing information about different people. So I decided to make a class that will hold the information for each person (for example: nickname, name, e-mail, web address and so on), then using the ObjectOutputStream the information will be save to a file. If I want to add a new record for a new person I'll simply append it to the already existing file. So far so good but soon I discovered that I can not read the appended objects using ObjectInputStream.
    What I mean is that if I create new file and then in one session save several objects to it using ObjectOutputStream they all will be read with no problem by ObjectInputStream. But after that if in a new session I append new objects they won't be read. The ObjectInputStream will read the objects from the first session after that IOException will be generated and the reading will stop just before the appended objects from the second session.
    The following is just a simple test it's not actual code from the program I was talking about. Instead of objects containing different kind of information I'm using only strings here. To use the program use as arguments in the console "w" to create new file followed by the file name and the strings you want save to the file (as objects). Example: "+w TestFile.obj Thats Just A Test+". Then to read it use "r" (for reading), followed by the file name. Example "+r TestFile.obj+". As a result you'll see that all the strings that are saved in the file can be successfully read back. Then do the same: "+w TestFile.obj Thats Second Test+" and then read again "+r TestFile.obj+". What will happen is that the strings only from the first sessions will be read and the ones from the second session will not.
    I am sorry for making this that long but I couldn't explain it more simple. If someone can give me a solution I'll be happy to hear it! ^.^ I'll also be glad if someone propose different approach of the problem! Here is the code:
    import java.io.*;
    class Fio
         public static void main(String[] args)
              try
                   if (args[0].equals("w"))
                        FileOutputStream fos = new FileOutputStream(args[1], true);
                        ObjectOutputStream oos = new ObjectOutputStream(fos);
                        for (int i = 2; i < args.length ; i++)
                             oos.writeObject(args);
                        fos.close();
                   else if (args[0].equals("r"))
                        FileInputStream fis = new FileInputStream(args[1]);
                        ObjectInputStream ois = new ObjectInputStream(fis);
                        for (int i = 0; i < fis.available(); i++)
                             System.out.println((String)ois.readObject());
                        fis.close();
                   else
                        System.out.println("Wrong args!");
              catch (IndexOutOfBoundsException exc)
                   System.out.println("You must use \"w\" or \"r\" followed by the file name as args!");
              catch (IOException exc)
                   System.out.println("I/O exception appeard!");
              catch (ClassNotFoundException exc)
                   System.out.println("Can not find the needed class");

    How to read appended objects from file with ObjectInputStream? The short answer is you can't.
    The long answer is you can if you put some work into it. The general outline would be to create a file with a format that will allow the storage of multiple streams within it. If you use a RandomAccessFile, you can create a header containing the length. If you use streams, you'll have to use a block protocol. The reason for this is that I don't think ObjectInputStream is guaranteed to read the same number of bytes ObjectOutputStream writes to it (e.g., it could skip ending padding or such).
    Next, you'll need to create an object that can return more InputStream objects, one per stream written to the file.
    Not trivial, but that's how you'd do it.

  • How to write data to existing file using spool command?

    Hi,
    I am calling a stored procedure from a shell script. This stored procedure is having a CLOB object as an OUT parameter. How to write the data in CLOB object a existing file which is there in my client system. Below is the shell and sql scripts.
    Shell script
    ( echo "hello" ) > /root/file.txt
    sqlplus -s $user/$pass@$tns @/root/proc.sql /root/file.txt << EOF
    EOFSQL script
    set pages 0
    set trimspool off
    set serveroutput off
    set feedback off
    set term off
    set echo off
    variable out CLOB
    define file='&1'
    begin
    pack.proc(:out);
    end;
    spool &file
    select :out from dual;
    spool offThis code writes contents of the OUT variable to file.txt, but my existing data ('hello') is lost. Please help me.
    I figured the it...Use append in the spool command... :)
    Edited by: Balaji on Jul 19, 2012 8:55 PM

    >
    Hi Balaji
    I figured the it...Use append in the spool command... :Please mark the thread as answered as per the FAQ.
    Paul...

  • Write to existing file using servlets

    Every time I try to read an existing file using my current set of servlets, I get "File cannot be found". I don't understand what the problem is because I'm using the exact same location as the code where I read the document. Is there something else I'm missing? I've tried countless methods of writing, each will compile and such, but all give me the same result (IE nothing). Here's how my horrific code looks right now. Much was taken from the previous code that checks the passwords file.
    Technically, it compiles and runs, but I get "java.io.FileNotFoundException: \WEB-INF\passwords (The system cannot find the path specified)" in the output. The file IS THERE and can be read in my password checking servlet without a problem...
    package hw3Pack;
    import java.io.*;
    import java.util.*;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;
    public class passCheck extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
            response.setContentType("text/html");
            HttpSession session = request.getSession(true);
            PrintWriter out = response.getWriter();
            try {
                    String filename = "/WEB-INF/passwords";
                    String email = request.getParameter("email");
                    String password = request.getParameter("password");
                    String remember = request.getParameter("remember");
                    ServletContext context = getServletContext();
              FileOutputStream fos = new FileOutputStream(filename);
                    InputStream is = context.getResourceAsStream(filename);
              if (!is.equals(null)) {
                   InputStreamReader isr = new InputStreamReader(is);
                   BufferedReader reader = new BufferedReader(isr);
                   String text = "";
                            } // if (is != null)
                    else {
                    } // else (password not blank)
            finally {
                out.close();
            } // finally
    }

    OK... I feel a bit dumb now... This code was working earlier (the writing part) and now it's not working since I added in the username check portion. It should be essentially complete at this point, I just need to figure out why it no longer writes the file. Any clues or insights?
    I'm about to add a password checker (confirm both passwords entered on registration form are equal) Lets hope I don't mess more up...
    package hw3Pack;
    import java.io.*;
    import java.util.*;
    import javax.servlet.ServletContext;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;
    import java.net.*;
    public class regComplete extends HttpServlet {
      public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException {
            response.setContentType("text/html");
            HttpSession session = request.getSession(true);
            PrintWriter out = response.getWriter();
            boolean clear = true;
            try {
                    String email = request.getParameter("email");
                    String password = request.getParameter("password");
                    out.println(email +" and " + password);
                    String filename = "/WEB-INF/passwords";
                    ServletContext context = getServletContext();
                    InputStream is = context.getResourceAsStream(filename);
              if (!is.equals(null)) {
                   InputStreamReader isr = new InputStreamReader(is);
                   BufferedReader reader = new BufferedReader(isr);
                   String text = "";
                            while ((text = reader.readLine()) != null) {              
                                    StringTokenizer st = new StringTokenizer(text, "," );
                                    String getEmail = st.nextToken();
                                    String getPass = st.nextToken();
                                            if (email.equals(getEmail) && !email.equals(null)) {
                                                    clear = false;
                                                    out.println("I'm sorry but that email address is in use.  Please try again.");
                                            } else {
                                            //do nothing
                    if (clear==true) {
                        File file = new File("/WEB-INF/passwords");
                        BufferedWriter writer = new BufferedWriter(new FileWriter(file, true));
                        out.println("going");
                        writer.append("\r\n" +email +"," +password);
                        out.println("Writing");
                        writer.close();
                        } else {
                } // try
            finally {
                out.close();
                } // finally
      }

  • LabVIEW created .DAT file with saving only new data on existing files

    I can successfully create and save a .DAT file using LabView and Diadem.   The save command I am using (in Labview) only overwrites existing files, I would like it to save only the new data from the last save.  Overall I would like to save the data every 1hr and since my test will last for many hours, the further along in the test the longer it would take to save the full file.  I know Diadem has the capability to save in such a manner, so I have thought about after I write to Diadem have a small Diadem application save periodically, but I haven't found a way to save the .DAT file, with out any signals coming into the save function.  I have attached the example .DAT file creater and saver I am using to figure it out.  thanks for your help!

    Howdy New Guy -
    I am not sure if you are looking to append to a file, or if you would
    like to overwrite a file.  In either case, you can take a look at
    the "Append To File.vi" example for DIAdem. 
    Either way, you may be experiencing problems because you are only using
    the "DIAdem Simple File Write.vi" (found on the DIAdem >> DAT
    Files palette).  Instead, you can use the "DIAdem File Write.vi"
    (located on teh DIAdem >> DAT Files >> DAT Files Advanced
    palette).  This VI can be set to overwrite or append to file.
    I hope this helps in your development!
    Andrew W. || Applications Engineer

  • Append to a file

    Hi:
    How do I actually append something to an existing file.
    Is it actually possible??
    Please let me know.
    Thanks

    PrintWriter fileWriter = new PrintWriter(new BufferedWriter(new FileWriter("myfile", true)), true);
    This will give you a file writer in append mode with auto flash.
    PC

  • Output on existing file at the begining??

    Hi,
    I have a problem about outputing.
    I want to write some texts at the begining of existing file.
    eg... file A
    "Hello
    then i want to insert some texts at the begining
    e.g. insert "YOU"
    then file A
    will become
    "YOU HELLO
    any idea?
    thank alot

    In order to make room for new data at the beginning of a file it is neccessary to shift the original files content towards the end of the file. This cannot be done without copying (read/write) the whole content of the file.
    But as you mentioned the term log-file have a look at other log-files written by applications. The newest entry is always at the end of the file. The reason for this is that people encounterd the same problem you have right now.
    As a matter of fact, if I read any file with log-entries in my editor I jump to the end of the file right away and start reading the entries backwards from there. People are used to it, just append your log-entries to the end of the file.

  • How to append to zip files

    I would like to know how to append to a zip file, I know how to write a zip file and I can put as many entries in the first time but if I run my program again and try to add a file to the same zip file it erases what was already in it. I use ZipOutputStream(new FileOutputStream), I have tried the FileOutputStream append but it does not seem to work for zip files, I have tried RandomAccessFile on my zip file but that just seems to add the bytes to the file that already in the zip file, and makes the file unopenable, corrupt. If you can help, please tell me how.

    You actually have to open the previous zipped file, read it's entries and their data and then rewrite a new zip file with these entries and their data. You can then delete your first file and rename the new one so the effect is that you have "appended" zip files to the existing archive.
    Here is an example which I pieced together from a larger bit of code that I have. This would need to be in a try/catch but this should give you a start.
    /** This method adds a new file to an existing zip file. It * includes all the zipped entries previously written.
    * @param file The old zip archive
    * @param filename The name of the file to be Added
    * @param data The data to go into the zipped file
    * NOTE: This method will write a new file and data to an archive, to
    * write an existing file, we must first read the data frm the file,
    * then you could call this method.
    public void addToArchive(File file, String filename, String data)
         ZipOutputStream zipOutput = null;
    ZipFile zipFile = null;
    Enumeration zippedFiles = null;
    ZipEntry currEntry = null;
    ZipEntry entry = null;
    zipFile = new ZipFile( file.getAbsolutePath() );
         //get an enumeration of all existing entries
    zippedFiles = zipFile.entries();
         //create your output zip file
    zipOutput = new ZipOutputStream( new FileOutputStream ( new File( "NEW" + file.getAbsolutePath() ) ) );
    //Get all the data out of the previously zipped files and write it to a new ZipEntry to go into a new file archive
    while (zippedFiles.hasMoreElements())
    //Retrieve entry of existing files
    currEntry = (ZipEntry)zippedFiles.nextElement();
    //Read data from existing file
    BufferedReader reader = new BufferedReader( new InputStreamReader( zipFile.getInputStream( currEntry ) ) );
    String currentLine = null;
    StringBuffer buffer = new StringBuffer();
    while( (currentLine = reader.readLine() ) != null )
    buffer.append( currentLine);
    //Commit the data
    zipOutput.putNextEntry(new ZipEntry(currEntry.getName()) ) ;
    zipOutput.write (buffer.toString().getBytes() );
    zipOutput.flush();
    zipOutput.closeEntry();
    //Close the old zip file
    zipFile.close();
    //Write the 'new' file to the archive, commit, and close
    entry = new ZipEntry( newFileEntryName );
    zipOutput.putNextEntry( entry );
    zipOutput.write( data.getBytes() );
    zipOutput.flush();
    zipOutput.closeEntry();
    zipOutput.close();
         //delete the old file and rename the new one
    File toBeDeleted = new File ( file.getAbsolutePath() );
    toBeDeleted.delete();
         File toBeRenamed = new File ( "NEW" + file.getAbsolutePath() );
    toBeRenamed.rename( file );
    Like I said I haven't tested this code as it is here but hopefully it can help. Good luck.

Maybe you are looking for

  • Purchase order type in sales order header

    Dear Friends, how can I make purchase order type in sales order header be default. With regards

  • Avi to Mov conversion software for Mac

    Since I can't search I may be asking a redundant question, but can anyone help me with locating some software for the Mac that will help me to convert some .avi files to .mov? Thanks, Jim

  • Missing part in process order

    Dear ALL , I ahve one issue ....in process order , when I check material availaility , its showing missing part list even though there is sufficinet stock , at MMBE its showing resarvation . For this I have checked folloing possibilities 1) I did Tec

  • Task form deployment error

    when i try to deploy even with a simple payload task the apache ant shows that [deployTaskForm] BindWebApp error: javax.management.ReflectionException [deployTaskForm] BUILD FAILED F:\BpelApp\attachMail\build.xml:100: Error while deploying the form o

  • Why we are using No_Filtering hint?

    Hi can anyone tell me why we are using No_Filtering hint? This query is Retriving extra rows when hints not applied.What is the reason. Select /*+ No_Filtering */ * from (select /*+ No_Filtering */ true_name, true_name_cmprsd, jurisname, entityids, h