BashbeginnercliAI generated

Directory Sync & Conflict Logger

A Bash script that uses rsync to mirror two directories, detects conflicting file changes by comparing checksums and timestamps, and writes a structured log of every sync action and conflict. Learners practice rsync flags, checksum comparison with sha256sum, and structured logging patterns in shell scripts.

Estimate
~7h
Steps
5
Completed by
0
Proposed by
codeseed.app

rsync · sha256sum · cron

Project roadmap

  1. 01

    Set up test directory pairs

    ~0.5h

    Create source and destination directories with sample files, including some that differ, to test sync behavior against.

  2. 02

    Write the basic rsync wrapper

    ~1.5h

    Write a script that calls rsync with -av flags to mirror source into destination and captures its output.

  3. 03

    Add checksum-based conflict detection

    ~2h

    Before syncing, compare sha256sum of files that exist in both locations and flag ones that differ without a clear newer version.

  4. 04

    Implement structured logging

    ~1.5h

    Redirect all sync actions and conflicts to a timestamped log file using a consistent format (date, action, file, result).

  5. 05

    Add a cron-friendly summary mode

    ~1.5h

    Add a --summary flag that prints a digest of conflicts found, suitable for a nightly cron job.

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~7h · 5 steps

Tech stack

rsyncsha256sumcron