# emdebian-grip

## grip-cron.sh manpage

GRIP-CRON.SH

1 EMDEBIAN-GRIP EMDEBIAN-GRIP

grip-cron.sh

cron job for Emdebian Grip with a logfile

              /usr/share/emdebian-tools/grip-cron.sh
              -b
              --base-path

                --t
                --tmpfs

                --e
                --edos-only

#### DESCRIPTION

`grip-cron.sh` is a wrapper for cron to automate updates using `em_autogrip`, using a logfile for all output.

The filter repository is updated against a Debian mirror, updated packages are downloaded and gripped, packages that have migrated into Debian testing are also migrated into Emdebian Grip testing and dependency checks are run.

Note that `grip-cron.sh` can take large amounts of time, temporary disc space, CPU and network bandwidth during each run, depending on the number of changes in the relevant Debian archives since the last run of `grip-cron.sh`. Unpacking and repacking Debian binary packages can use a tmpfs if already mounted. Ensure that the directory for the tmpfs is writeable by the process / user running `grip-cron.sh`. You may need to use `sudo mkdir` to create a suitable directory in your tmpfs and then use `sudo chown` for the user running `grip-cron.sh`. tmpfs will use swap space if appropriate but problems can occur if your tmpfs does not provide enough space to unpack the larger Debian packages in Grip (generally build dependencies) which can be more than 11Mb compressed.

`-b`|`--base-path`

- The top level directory of the Emdebian Grip repository. If your filter and grip repositories are in /path/filter/ and /path/grip/, the `base-path` is /path.

  The `base-path` must always be specified when using `grip-cron.sh`.

`-t`|`--tmpfs`

- The path to a writeable directory within an tmpfs which must be already mounted.

  ##### Tmpfs will not grow dynamically

  Using a tmpfs could mean that certain packages fail to be updated because `dpkg -X` failed with an error of No space left on device. Check the `grip-cron.sh` logfiles and enlarge the tmpfs before running `grip-cron.sh` again.

`-e`|`--edos-only`

- Skips the updates and just runs the edos checks for each architecture, outputting to the logfile as usual. This is useful when just adding and updating packages to fix missing dependencies.

  `--tmpfs` has no effect in this mode.

#### Examples

##### Example crontab

    0 2 * * * /usr/share/emdebian-tools/grip-cron.sh -b /opt/reprepro

##### Example to setup the tmpfs

The size of the tmpfs is open to debate. A tmpfs can use swap space if not enough RAM is available for the contents of the tmpfs but the size of the tmpfs itself cannot be changed without unmounting and remounting it. i.e. not without restarting `grip-cron.sh`. Packages that attempt to unpack more files than the tmpfs can hold will fail to be updated. Check the logs carefully.

    $ cd /opt/reprepro/
    $ mkdir tmpfs
    $ sudo chmod +t tmpfs
    $ sudo chmod 777 tmpfs
    $ sudo mount -t tmpfs -o size=1G,user tmpfs tmpfs/

crontab for this setup:

    0 2 * * *  /usr/share/emdebian-tools/grip-cron.sh -b /opt/reprepro -t /opt/reprepro/tmpfs