locked
to write the small backup program of entire file of a folder to another folder RRS feed

  • Question

  • Hi

    I have a  source folder   

    c:\myapp\text1.txt

    c:\myapp\text2.txt

    c:\myapp\text3.txt

    c:\myapp\training\>training.doc 

    Also I have the  another folder e:\BackupApp\> 

    I want to copy all the files from source folder to target folder only if there  is any changes  from the source folder and if there is new files in the source folder. I short, I want to copy to target folder  only  new files and changed files from the source folder. But if we are overwritting any existing file in target folder , the previous files  should be moved to another folder 'Archive23022020' in e:\Backup.  to keep history  of the changed content of the files. So when we move the old file should be named as  <filename>_1, <filename_2> on the current date Archive folder. If there is no Archive+Currentdate folder , should be created  automatically before taking the backup. Please can you give the code  in powershell to take the backup



    polachan



    • Edited by polachan Sunday, February 23, 2020 10:24 PM
    Sunday, February 23, 2020 7:15 PM

All replies

  • Just use git or other version control. Life is too short to reinvent a wheel.

     -- pa

    Monday, February 24, 2020 12:35 AM