#!/usr/bin/env zsh set -x set -e set -o nullglob YYYYMMDD="$(date "+%Y-%m-%d")" RSYNCOPTS="-ah --no-inc-recursive --info=progress2" RDST="root@las1stor1:/srv/pool.2024.04/berlin.sneak.fs.video" function rename_to_format() { f2 -r '{{mtime.YYYY}}/{{mtime.YYYY}}-{{mtime.MM}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}/{{mtime.YYYY}}-{{mtime.MM}}-{{mtime.DD}}.{{f}}.{{hash.sha256}}{{ext}}' -x --verbose } function import() { rename_to_format rsync -avP ./2* $RDST/ } function main() { import } main