File List
Not logged in

The union of all files from all check-ins in directory wiki_references/2019/software/mail_and_messaging/matrix_org/src_from_GitHub/the_repository_clones/log_archiver   [history]


A python script to move old log files from various services on various machines to a locale archive directory using SSH.


$ python -h
usage: python [-h] [-v] [-n] [--remove] [--use-ssh-agent] config

positional arguments:

optional arguments:
  -h, --help       show this help message and exit
  -v, --verbose    increase output verbosity
  -n, --dry-run    print files that would be archived
  --remove         remove files from remote
  --use-ssh-agent  allow using keys from ssh agent

The script will look for SSH keys in ~/.ssh.

Note that the script doesn't remove files on the remote by default for safety reasons. You'll probably want to add something like the following to cron:

@daily python log_archiver/ service.yaml --remove

Example config

archive_dir: /mnt/logs/archived

    account: matrix
    directory: /home/matrix/synapse/var/
    pattern: "*.log.<DATE->*"
    days_to_keep_on_remote: 2