/adstxt-sync-bash

Bash-Script to merge ads.txt entries from trusted sources.

Primary LanguageShellMIT LicenseMIT

adstxt-sync-bash

Merge ads.txt entries from trusted sources.

Requirements

  • wget or curl to download external files
  • mktemp to create temporary files
  • a cron daemon to schedule the sync periodically

Configuration

Edit SOURCES and ADSTXT in adstxt-sync.bash:

SOURCES=(
    "/path/to/ads-local.txt"
    "https://tag.md-nx.com/config/site/<siteid>/ads.txt"
)
ADSTXT="/path/to/ads.txt"

Manual Execution / Testing

Execute the bash script directly from command line:

$> ./adstxt-sync.bash

Cronjob Installation

Edit crontab:

$> crontab -e

Install the following crontab to execute every two hours:

# MIN HOUR DAY MONTH DAYOFWEEK COMMAND
0 */2 * * * /path/to/adstxt-sync.bash