Home Forums Programming Powershell implementing backup system using PS (a newbie question) RE: implementing backup system using PS (a newbie question)

  • GeriReshef (5/26/2015)


    Thanks for your answer!

    I will try to explain what I'm trying to find..

    A year ago I was asked to develop a central system for backups. Till then, for every backup, a separate job had been created. With ~50 servers, it was a very bad practice.

    My manager asked me if I intended to do it using PS, maybe because it was considered to be a good tool for administrative tasks. I'm the TSQL guy in the company, I told him that I didn't know PS, and it would have taken time to begin studying this subject, and that I would have preferred to do it using TSQL.

    A famous proverb says that for the hammer, every problem is a nail: if I were the C# guy I would have developed a system with nice forms, which would have accessed each server using a connection string; and if I were the system guy, I would have used the tool they have used to backup disks & sub-directories & files.

    As I have mentioned in my previous message, I created a table with all the details, linked servers to all the servers and a job which using a cursor, backups each database to a separate sub-directory. Additionally, each time, the job deletes old files using xp_cmdshell & del (command line).

    Now I have some spare time, and I want to try to find out how I was expected to do it using PS, and beside to get into PS..

    The man who told me to develop this system, just wanted a reliable central system, and let me do it in my way. He was not an expert nor in TSQL nor in PS.

    Now, if you were asked to do it using PS, what would you have said:

    1. Come on, that's not a task for PS: it is a very bad idea.. let's do it with TSQL!

    2. {here I expect to hear a suggestion how to do it using PS}

    I hope I made myself clear (my English is not the best).

    First, let me ask you what happens when your "centralized backup system" is down. Think about it.

    Second, you stated the following...

    A job in the central SQL Server initiate the process once a day.

    Any data worth having is worth protecting and backing up just once per day is a very thin veil of protection. Are you sure that the company would still be happy if a system lost up to 24 hours of data? I strongly recommend setting it up so that Point-In-Time log backups are taken at least once ever hour. More if you can.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)