spacewalk-repo-sync

8 Version 3.5.0

`spacewalk-repo-sync`

Syncs the content from yum repos into SUSE Manager channels.

    	spacewalk-repo-sync
    	options ...

            -c CHANNEL_LABEL
    	--channel=CHANNEL_LABEL

            -p CHANNEL_LABEL
    	--parent-channel=CHANNEL_LABEL

            -l
    	--list

            -s
            --show-packages

            -u URL
    	--url=URL

            -g CONFIG
            --config=CONFIG

            -n
    	--latest

            -t TYPE
    	--type=TYPE

            -f
    	--fail

            -i FILTERS
    	--include FILTERS

            -e FILTERS
    	--exclude FILTERS

    	--email

    	--traceback-mail=EMAIL_ADDESS(ES)

    	--no-errata

    	--sync-kickstart

    	--force-all-errata

            -Y
            --deep-verify

    	--batch-size=BATCH_SIZE

    	--dry-run

            -n
            --non-interactive

            -v
    	--verbose

## Description

The spacewalk-repo-sync tool is used to sync packages from external or local yum repositories. All the packages within the specified repository will be added to the channel.

Any url supported by yum is supported by this utility, including mirror lists. If the url is not supplied, the tool will look to see what repositories are associated with the specified channel and use those.

Additional configuration options for yum_src plugin can be placed in `/etc/rhn/spacewalk-repo-sync/yum.conf`. You may configure per-channel options as documented in yum.conf(5) manual page. Don't forget to put [main] section there.

## Options

-h, --help

- Display the help screen with a list of options.

-c `CHANNEL`, --channel=`CHANNEL`

- The channel to sync the repository to.

-p `CHANNEL`, --parent-channel=`CHANNEL`

- Synchronize the parent channel and all its child channels.

-u `URL`, --url=`URL`

- The repository URL. Any protocol supported by yum is supported including http://, nfs://, file://. Can be used multiple times in order for more than one repository to be assigned to a channel.(Optional)

-l, --list

- List the custom channels with the associated repositories.

-s, --show-packages

- List all packages in a specified channel.

-g `CONFIG`, --config=`CONFIG`

- Configuration file where more than one channel can be specified for synchronization. See section Examples.

-n, --latest

- Sync latest packages only. Use carefully - you might need to fix some dependencies on your own.

-t `TYPE`, --type=`TYPE`

- The type of repository to sync. Currently only yum, uln and deb are supported. The uln type is used to sync with the Oracle Unbreakable Linux Network. The deb type is used for Debian repositories. This option overrides type of repository stored in DB for given repository.

-f, --fail

- By default if an error occurs with a single package, the rest of the sync continues. When using this option, the entire sync will terminate upon any error.

-v, --verbose

- Print verbose output. Possible to accumulate: -vvv

-i `FILTERS`, --include `FILTERS`

- Comma or space separated list of included packages or package groups.

-e `FILTERS`, --exclude `FILTERS`

- Comma or space separated list of excluded packages or package groups.

--email

- e-mail a report of what was synced/imported (sent to whomever is considered the receiver of "traceback_mail").

--traceback-mail=`EMAIL_ADDRESS(ES)`

- alternative email address(es) for all sync correspondence. Example: --traceback-mail="user1@example.com, user2@example.com".

--no-errata

- Do not sync errata

--sync-kickstart

- Attempt to create kickstartable tree (distribution) if there is subdirectory images/pxeboot/ under repo's URL. The option is ignored for repositories set from CLI via option [-u|--url].

--force-all-errata

- process metadata of all errata, not only missing.

--batch-size=`BATCH_SIZE`

- maximum batch size for package import

  This option should not be used except for debugging purposes. The most useful case being --batch-size=1 where the database import process each piece of meta-data one at a time, isolating any issues.

  WARNING: --batch-size=1 will dramatically slow down the sync process.

--batch-size=`BATCH_SIZE`

- maximum batch size for package import

  This option should not be used except for debugging purposes. The most useful case being --batch-size=1 where the database import process each piece of meta-data one at a time, isolating any issues.

  WARNING: --batch-size=1 will dramatically slow down the sync process.

-Y, --deep-verify

- Do not use cached package checksums.

--dry-run

- Test run. No sync takes place.

-n, --non-interactive

- Do not ask anything, use default answers.

## Configuration files

/etc/rhn/rhn.conf

- server.satellite.reposync_download_threads = 5

- Set maximum number of threads to be used for simultaneous downloads.

## Examples

- List all custom channels and the repositories assigned to them.
- `spacewalk-repo-sync --list`
- Synchronize single channel to all repositories assigned to it via WebUI or API.
- `spacewalk-repo-sync --channel custom-channel`
- Synchronize single channel to a repository specified on the command line.
- `spacewalk-repo-sync -c custom-channel --url=http://example.com/yum-repo/`
- Synchronize single channel to a local repository specified on the command line.
- `spacewalk-repo-sync -c custom-channel --url=file:///var/share/localrepo/`
- Synchronize single channel to a repository(mirror list) specified on the command line.
- `spacewalk-repo-sync -c custom-channel --url=http://example.com/mirrorlist.xml/`
- Synchronize single channel to more than one repository specified on the command line.
- `spacewalk-repo-sync -c custom-channel --url=http://example.com/yum-repo/ --url=http://example.com/yum-repo_2/`
- Synchronize parent channel and all its child channels. All channels must have repository assigned via WebUI or API.
- `spacewalk-repo-sync -p parent-channel`
- `spacewalk-repo-sync -c custom-channel --url=http://example.com/yum-repo/ -p parent-channel`
- Synchronize channels specified in configuration file.
- `spacewalk-repo-sync --config example.conf`
- `spacewalk-repo-sync --config example.conf -c custom-channel --url=http://example.com/yum-repo/ -p parent-channel --fail`
- Example configuration file.

-     {
       "no_errata":false,
       "sync_kickstart":false,
       "fail":true,
       "dry_run":false,
       "channel":{"chann_1":["http://example.com/repo1","http://example.com/repo2"],"chann_2":[]},
       "parent_channel":["parent_1","parent_2"]
      }

- In order just to test the configuration use option --dry-run.
- `spacewalk-repo-sync --config example.conf --dry-run`

## Authors

- Justin Sherrill jsherril@redhat.com