title: Scheduling a pgagent job for every alternate friday
body: <p>I am unbale to find a way to schedule pgagent job for every alternate fridays.Can anybody help me with that ?
  Below is the code shell script I include it in pgagent job</p>
  <pre><code>#!/bin/bash
  #backup directory can be a file server share that the PgAgent 
  daemon account has access to
  BACKUPDIR=&quot;/home/natasha/databasebackup&quot;
  PGHOST=&quot;localhost&quot;
  PGUSER=&quot;postgres&quot;
  PGBIN=&quot;/usr/bin&quot;
  PGDATABASE=&quot;backup&quot;
  thedate=`date --date=&quot;today&quot; +%Y%m%d%H`
  thefortnight=`date --date=&quot;today&quot; +%Y%m%d`
  
  #truncate history table 
  psql -h $PG_HOST -U $PGUSER -d $PGDATABASE -c &quot;TRUNCATE TABLE 
  public.history;&quot;
  
  $PGBIN/pg_dump -h $PG_HOST -U $PGUSER -d $PGDATABASE -F c -b -v -f 
  </code></pre>
  <p>$BACKUPDIR/$thedate.backup</p>
  <p><a href="https://i.stack.imgur.com/ckNy9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ckNy9.png" alt="Image for Scheduling in Pgagent" /></a></p>