Arch Linux Archive Tools
========================

Introduction
------------
**archivetools** is the project used to run the [Arch Linux Archive](https://wiki.archlinux.org/index.php/Arch_Linux_Archive). It's a turnkey solution to snapshot [Arch Linux](https://www.archlinux.org) packages repositories, ISOs images and boostrap tarballs. You can deploy one for your own needs.

The **Archive** is built by rsync'ing [rsync.archlinux.org](rsync://rsync.archlinux.org), or its mirrors, each day. *Rsync* features are used to transfer only the diff of new data from the previous snapshot and files are stored once with use of hardlinks.

Installation
------------
Create a pacman package and install it.

```bash
cd archivetools
makepkg -i
systemctl enable archive.timer
```

Testing
-------
The project includes automated tests that can be run locally or in CI:

### Local Testing
```bash
# Set up test configuration
export DEBUG=1
export ARCHIVE_CONFIG=test-archive.conf

# Run the archive script
./archive.sh

# Test the cleaner
./archive-cleaner --repo "$HOME/test-archive/repos/last" --archive "$HOME/test-archive" --keep-years 1
```

### CI Testing
The project uses GitLab CI for automated testing. To run tests locally using gitlab-runner:

```bash
# Install gitlab-runner
sudo pacman -S gitlab-runner

# Run CI locally
gitlab-runner exec docker test
```

Or using gitlab-ci-local:
```bash
sudo pacman -S gitlab-ci-local
sudo gitlab-ci-local
```

Dependencies
------------
- [Bash](http://www.gnu.org/software/bash/bash.html)
- [Rsync](http://rsync.samba.org/)
- [Hardlink](http://jak-linux.org/projects/hardlink/)
- [xz](http://tukaani.org/xz/)
- [util-linux](https://www.kernel.org/pub/linux/utils/util-linux/)
- [Python](https://www.python.org/)
- [python-libarchive-c](https://github.com/libarchive/python-libarchive-c)
- [pacman-contrib](https://gitlab.archlinux.org/pacman/pacman-contrib) (for pacsort)

Development Dependencies
----------------------
For testing and development:
- gitlab-runner or gitlab-ci-local (for CI testing)
- git (for version control)

Sources
-------
**archivetools** sources are available on [github](https://github.com/seblu/archivetools/).

License
-------
**archivetools** is licensied under the term of [GPL v2](http://www.gnu.org/licenses/gpl-2.0.html).

Author
------
**archivetools** was started by *Sébastien Luttringer* in August 2013 to replace the former *Arch Linux Rollback Machine* service.
