App-DistSync

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

Format:
```
DIRNAME/FILENAME   MTIME   SIZE   MTIME_AS_STRING
```

Paths are relative, with `/` used as the separator regardless of OS.

### MANIFEST.SKIP

Editable descriptor defining which files must be excluded from `MANIFEST`. Supports Perl-compatible regular expressions in YAML format.

The following files are always ignored:
```
META
MANIFEST
MANIFEST.DEL
MANIFEST.SKIP
MANIFEST.LOCK
README
```

Format:
```
DIRNAME/FILENAME   COMMENT
```

### MANIFEST.DEL

Editable descriptor listing files that must be deleted after a specified offset (`DTIME`). `DTIME` is relative to the modification time of `MANIFEST.DEL` itself (default: `+3d`).

The file is **not synchronized**, but remote mirrors download it and delete the listed files locally. After processing, the file is cleared and recreated.

Format:
```
DIRNAME/FILENAME   DTIME
```

### MIRRORS

Editable descriptor listing the URLs of all mirrors. The current resource **must** be included in this list.

Format:
```
URL   COMMENT
```

### MANIFEST.LOCK

*NOT EDITABLE.* Contains the PID of the process performing synchronization. Prevents concurrent `distsync` runs across mirrors.

### MANIFEST.TEMP

*NOT EDITABLE.* Temporary file holding downloaded data. May persist between runs.

### README

Optional, local-only informational file. Not synchronized. If you need it to sync, use `README.md` instead.

## GETTING STARTED

After initialization, edit the `MIRRORS` file and add the new mirror’s URL. Then upload the updated file to any existing mirror so others can discover the new resource.

Run the first synchronization:

```bash
distsync -D /var/www/foo.localhost sync -d
```

`-d` enables progress output; `-dv` adds more verbose diagnostics.

### Important option

`-D DATADIR` — Specifies the local resource directory where synchronized files are stored.

Help:
```bash
distsync --help
man distsync
```

## PRODUCTION USE

Once mirrors can reach the newly created resource, it may be scheduled for automatic, periodic synchronization. The most common method is cron.

Example crontab entry:
```cron
37 * * * * /usr/bin/distsync -D /var/www/foo.localhost >/var/log/distsync.log 2>&1
```

All logs and errors are written to `/var/log/distsync.log`.

### Adding files

Copy files into the resource directory. They will be synchronized automatically.

### Deleting files

Add filenames to `MANIFEST.DEL`. The system will handle deletion. You may remove files from disk manually afterwards.

### Updating files

Replace the file with a newer version. Synchronization will propagate the change.

âš  **Do NOT rename or move files or directories.**
Missing items will be recreated during synchronization, leading to divergence or duplication across mirrors.



( run in 2.599 seconds using v1.01-cache-2.11-cpan-b16cb0d3907 )