Schedule Automatic Backups for PostgreSQL with pgAgent in pgAdmin

Поділитися
Вставка
  • Опубліковано 16 жов 2024
  • pgAgent is a tool used for scheduling jobs for PostgreSQL databases. It also has more powerful scheduling capabilities than the often-used cron because it is specifically built for handling Postgres tasks. For example, pgAgent can schedule multiple steps without a batch script or without repeating the command. It’s important to note that even if you have pgAdmin installed, pgAgent must be downloaded independently, specifically as an extension to pgAdmin.
    In this tutorial you will install pgAgent, configure your database to use pgAgent on the pgAdmin Graphical User Interface (GUI), set up pgAgent as a daemon, and then use pgAgent to schedule a job that will back up your database.
    Command used
    Step 1
    sudo apt install pgagent
    Step 2
    pgagent host=/var/run/postgresql dbname=sammy user=sammy
    Useful links:
    VPS/VDS - mivocloud.com/
  • Наука та технологія

КОМЕНТАРІ • 22

  • @ShineMDITDept.Ahalia
    @ShineMDITDept.Ahalia 6 місяців тому +1

    It is not working showing the f status in status table pga_joblog

  • @gayatritripathy1413
    @gayatritripathy1413 7 місяців тому +1

    Hi sir, how to take differential backup automatically using pgagent!?

    • @MivoCloud
      @MivoCloud  7 місяців тому

      Hello, soon i will shoot video for this topic

  • @jagadeeshjaga8703
    @jagadeeshjaga8703 Рік тому +1

    I'm getting this error while running the command stated at 01:53 as "WARNING: Couldn't create the primary connection"

    • @MivoCloud
      @MivoCloud  Рік тому

      Greetings! Did you have any problems in the earlier stages? Are you specifying the correct username and database? It is important that your user, like the database, has a password. For example, I used the same passwords for the user and the database. This could be one of the mistakes

  • @kuchpal7832
    @kuchpal7832 8 місяців тому +1

    Hi is there any option that I can restore data base automatically every day from a particular path

    • @MivoCloud
      @MivoCloud  8 місяців тому

      hello! I don't know yet, I'll look into this issue in the future

  • @GHEC-ARCHANASV
    @GHEC-ARCHANASV Рік тому +1

    Hi, I'm getting f in statics status as u got at 5:26. can u help me

    • @MivoCloud
      @MivoCloud  Рік тому

      Hello! I'll see what the problem might be, but in the meantime, check if your user has SUDO access to work with databases.

  • @linhmai8639
    @linhmai8639 4 місяці тому

    Sir, I want to create a backup database that can automatically backup and replace the main database for my university graduation project. I wonder if you can help me

    • @MivoCloud
      @MivoCloud  4 місяці тому

      Hello! It is certainly possible to do this, but you need to decide on the database

    • @linhmai8639
      @linhmai8639 4 місяці тому

      @@MivoCloud Yes sir, I simply want to create a test table in postgresql and complete the backup and restore of the database using pgAdmin4. I wonder if you can guide me, because it took me all day and I still can't install it. okay pgAgent, if possible I would be very grateful to you.

    • @MivoCloud
      @MivoCloud  4 місяці тому

      @@linhmai8639 Unfortunately, there is no such possibility. I will be able to make such a video, but it won't be until next month.

    • @linhmai8639
      @linhmai8639 4 місяці тому

      @@MivoCloud I sincerely apologize, but because I am a student working on my graduation project and want to add an additional database for my project, that's why I have such a request. I hope you can guide me as quickly as possible. I will send you $10 for that, as it is my gratitude because you have greatly helped me in my IT career.

    • @MivoCloud
      @MivoCloud  4 місяці тому

      @@linhmai8639 I will try to shoot this video as soon as possible, of course, you do not need money for this :) As a company, it will be enough for us to know that our customers who rent servers in the future are doing well

  • @pritamchavan6452
    @pritamchavan6452 Рік тому

    Hi sir once i run pgagent host=/var/run/postgresql dbname= ... Command I got error could not create the primary connection attempt 10 this issue is solved user name i put correct same password --- then other issues is showing sir ---- unsupported schema version version 4 is required please run pgagent_upgrade.sql ??? What is this --- pgagent is updated 4 already

    • @MivoCloud
      @MivoCloud  Рік тому

      Greetings! I have not encountered this problem, so I cannot give you an exact answer. However, try the following (If it requires an update, then it's worth a try)
      Try using ALTER EXTENSION:
      ALTER EXTENSION pgagent UPDATE;
      The SQL script's instructions do need to be corrected, however.