syscp

Package: WA2L/edrc 1.5.57
Section: General Commands (1)
Updated: 26 February 2013
Index Return to Main Contents

 

NAME

syscp - copy system file to sysconfig repository

 

SYNOPSIS

edrc/bin/syscp [ -h ]

syscp file ...

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

Copy an (active) file on the system to the sysconfig repository that has been used to configure the system.

If a file is in multiple repositories it can be interactively chosen to which repository the file should be copied.

If a system file does not differ (content or permissions) from the file residing in the repository a WARNING is displayed.

Each file copy has to be acknowledged.

If the system file differs from the repository file and the repository contains "replacement tags" in the format @[-_A-Z]+@ (e.g. @HOSTNAME@ in a hosts file) as used in post_exec and pre_exec scripts, a warning is displayed. Most likely it is not wished to overwrite such a repository file.

If a new file is added to a repository and a part of the path on the system is a symlink that is not already added to the repository, the new path to the file and the file is not added to the repository. This is a safety precaution. If you encounter this situation you most likely want to add the original path to the repository instead of the path thru the symlink.
An example of such a situation is to add /etc/init.d/nginx to the repository, where the init.d directory is on some systems a symlink to rc.d/init.d. In this case you should add /etc/rc.d/init.d/nginx to the repository.

 

OPTIONS

-h
usage message.

file ...
list of files to be copied to the repository.

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

2
operating system is not supported, yet. See osid(3) if you get this error.

4
usage printed.

5
command aborted pressing <Ctrl>+<C> or using kill(1).

 

FILES

<root_dir>/.EDRC.sysconfig <root_dir>/.EDRC.sysconfig.<name>
settings file which contains information about current active configuration. This file is read when using sysconfig-p, sysvi, syscp and sysdiff.

 

EXAMPLES

1) usage example

1.1) display the applied configurations

[ / ]
[ root@acme002 ][*edrc*/ksh]: sysconfig -p

sysconfig - configure a Unix/Linux system, by Chr. Walther

/ -

        CONFIG:      production.acme.ch
        NAME:
        OSID:        HP-11
        SOURCE:      /opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch
        ROOTDIR:     /
        BACKUPDIR:   /opt/edrc/var/backup
        BACKUPFILE:  2005-07-12_20.30.04__sysconfig.cpio.gz
        DESCRIPTION: PRODUCTION SERVER CONFIGURATION for Operating System
        EXECUTED:    Tue Jul 12 20:30:04 METDST 2005

/ - base

        CONFIG:      acme.ch
        NAME:        core
        OSID:        HP-11
        SOURCE:      /opt/edrc/scripts/ACME-sat/sysconfig/acme.ch
        ROOTDIR:     /
        BACKUPDIR:   /opt/edrc/var/backup
        BACKUPFILE:  2004-11-25_14.54.06__sysconfig.cpio.gz
        DESCRIPTION: BASE SERVER CONFIGURATION for Operating System
        EXECUTED:    Thu Nov 25 14:54:06 MET 2004

1.2) use of syscp

[ /etc ]
[ root@acme002 ][*edrc*/ksh]: syscp auto_apl services auto_dat ifconfig.muxids /etc/hosts \
                                    /etc/protocols /etc/init.d/nginx /var/opt/perf/parm

copy system file to '/opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/etc/auto_apl'? <yn>  [n] :y
syscp-INFO: system file copied to '/opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/etc/auto_apl'
syscp-HINT: do not forget to distribute the repository


syscp-WARNING: no difference to file '/opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/services'
copy system file to '/opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/services'? <yn>  [n] :


syscp-ERROR: file 'auto_dat' does not exist


syscp-WARNING: file 'ifconfig.muxids' is currently not member of a repository
syscp-INFO: multiple possible repositories for file 'ifconfig.muxids':
1) /opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/ifconfig.muxids
2) /opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/etc/ifconfig.muxids
select num:2
add system file as '/opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/etc/ifconfig.muxids'? <yn>  [n] :y
syscp-INFO: system file added as '/opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/etc/ifconfig.muxids'
syscp-HINT: do not forget to distribute the repository


syscp-INFO: multiple matches for file '/etc/hosts':
1) /opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/hosts
2) /opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/etc/hosts
select num:1
syscp-WARNING: replacement tags in repository file '/opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/hosts'
copy system file to '/opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/hosts' ? <yn>  [n] :


syscp-INFO: multiple matches for file '/etc/protocols':
1) /opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/protocols
2) /opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/etc/protocols
select num:1
copy system file to '/opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/protocols' ? <yn>  [n] :y
syscp-INFO: system file copied to '/opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/protocols'
syscp-HINT: do not forget to distribute the repository


syscp-WARNING: file '/etc/init.d/nginx' is currently not member of a repository
syscp-INFO: multiple possible repositories for file '/etc/init.d/nginx':
1) /opt/edrc/scripts/ACME-sat/sysconfig/acme.ch/HP-11/root/etc/init.d/nginx
2) /opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/etc/init.d/nginx
select num:2
syscp-ERROR: system file path '/etc/init.d -> rc.d/init.d' is a symlink, handle it first


copy system file to '/opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/var/opt/perf/parm'? <yn>  [n] :y
syscp-INFO: system file copied to '/opt/edrc/scripts/ACME-sat/sysconfig/production.acme.ch/HP-11/root/var/opt/perf/parm'
syscp-HINT: do not forget to distribute the repository

 

SEE ALSO

edrcintro(1), filelink(1), sysconfig(1), sysvi(1), sysdiff(1)

 

NOTES

-

 

BUGS

-

 

AUTHOR

syscp was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2013 Christian Walther

This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 00:14:28 GMT, March 08, 2025