Repository Public
1#!/bin/bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : FB Ka Automation8# File : posts/run_stats.sh9# Module : posts10# Repository : https://git.spboucher.ai/fb-ka-automation11# Created : 2026-12-0112# Last Modified : 2026-12-0113#14# Author : Simon-Pierre Boucher15# Position : Professor of Finance16# Institution : Université du Québec en Outaouais (UQO)17# Organization : SP Boucher18# Website : https://spboucher.ai19# Git : https://git.spboucher.ai20#21# Preferred Contact: contact@spboucher.ai22# Technical Contact: dev@spboucher.ai23# Security/Admin : admin@spboucher.ai24#25# Copyright (c) 202626# Simon-Pierre Boucher27# All rights reserved where applicable. This file is governed by the28# applicable project license, copyright notices and relevant law.29# Existing third-party rights and notices remain unaffected.30#31# License : None specified (no license file in this repository)32#33# Do not embed credentials, private keys, access tokens,34# certificates or confidential personal information.35#36# =============================================================================37# END OF SP BOUCHER SOURCE HEADER38# =============================================================================3940set -u41WIN=1393942LOG=/tmp/ka_posts/stats.log43: > "$LOG"44for f in /tmp/ka_posts/21-*.txt /tmp/ka_posts/22-*.txt /tmp/ka_posts/23-*.txt /tmp/ka_posts/24-*.txt /tmp/ka_posts/25-*.txt /tmp/ka_posts/26-*.txt /tmp/ka_posts/27-*.txt /tmp/ka_posts/28-*.txt /tmp/ka_posts/29-*.txt /tmp/ka_posts/30-*.txt; do45 echo "=== $(basename "$f") ===" >> "$LOG"46 ok=047 for attempt in 1 2; do48 if /tmp/ka_posts/fb_post.sh "$f" $WIN >> "$LOG" 2>&1; then ok=1; break; fi49 echo "(nouvel essai $attempt échoué, retry)" >> "$LOG"50 sleep 1551 done52 if [ $ok = 1 ]; then echo "SUCCESS $(basename "$f")" >> "$LOG"; else echo "FAILED $(basename "$f")" >> "$LOG"; fi53 sleep 3054done55echo "=== TERMINÉ ===" >> "$LOG"56