Skip to end of metadata
Go to start of metadata

20190602 - russfile v0.8 released

Contents

Introduction

The file server provides basic file services.

Configuration

No additional configuration supported.

Usage

Perform basic file operations.

All paths are expanded using UNIX style pathname pattern expansion
(* and ? wildcards, character ranges within []). A non-match results
in the original path being used.

Common options:
-B <size>
    Block size to use for transfer operations. Default is %s
    with a maximum of %s.
-C <dir>
    Change working directory on service side. Default is the home of
    the requesting user.
-f  Force operation. Depending on context, may mean overwrite an
    existing file object or ignore error and proceed.
-U <umask>
    Perform operations using a specific umask (default umask is 0%o);
    specifying a umask is almost always a good idea to avoid
    surprises from the default. <umask> may be specified in octal
    by a leading 0.

/chmod [-C <dir>] <mode> <path>
    Change file mode.

/chown [-C <dir>] <owner>[:<group>] <path>
    Change file ownership.

/copy [-C <dir>] [-f] [-U <umask>] <srcpath> <dstpath>
    Copy file srcpath to dstpath. If dstpath is a directory, srcpath
    will be copied into it.

/get [-B <size>] [-C <dir>] <path> [...]
    Read one or more files to stdout.

/gets [-B <size>] [-C <dir>] [-o <offset>] [-s <size>] [-w end|set] <path>
    Read file segment to stdout. Use -o and -w options to position
    the file pointer before reading. Use -s to limit size of data
    read from offset. Default offset is 0, default whence is end.
    Default size is unlimited.

/listdir <path>
    Return a list of directory entries, one per line.

/mkdir [-C <dir>] [-m <mode>] [-p] [-U <umask>] <path>
    Create directory. Default file mode is 0700. Use -p to create
    parent directories as needed.

/move [-C <dir>] [-f] <srcpath> <dstpath>
    Move file from srcpath to dstpath. If dstpath is an existing
    directory, srcpath will be moved into it.

/pack [-B <size>] [-C <dir>] [-U <umask>] <packtype> <path> [...]
    Pack files and write to stdout. Use -C to change directory
    before packing. <packtype> must be one of --tar, --tbz2, --tgz.

/put [-B <size>] [-C <dir>] [-f] [-m <mode>] [-U <umask>] <path>
    Write stdin to file.

/puts [-B <size>] [-C <dir>] [-m <mode>] [-o <offset>] [-U <umask>] [-w end|set] <path>
    Write stdin to file segment. Default file mode is 0600. Use -o
    and -w options to position the file pointer before writing.
    Default offset is 0, default whence is end, which is equivalent
    to append.

/remove [-C <dir>] [-f] <path>
    Remove file.

/rmdir [-C <dir>] [-p] <path>
    Remove empty directory. Use -p to remove parent directories.

/stat [-C <dir>] [-L] <path>
    Get path file status. Use -L to dereference <path>.

/symlink [-C <dir>] <srcpath> <linkname>
    Create symbolic link where <linkname> points to <srcpath>.

/touch [-C <dir>] [-U <umask>] <path>
    Change file timestamps.

/truncate [-C <dir>] [-s <size>] [-U <umask>] <path>
    Shrink or extend file size. Default is size of 0.

/unpack [-B <size>] [-C <dir>] [-U <umask>] <packtype>
    Unpack files read from stdin. <packtype> must be one of --tar,
    --tbz2, --tgz.

Examples

Copy file (happens where the service is hosted):

ruexec +/file/copy /tmp/abc.sh /tmp/def.sh

Copy file (occurs on remote host):

ruexec +/ssh/mach1/+/file/copy /tmp/abc.sh /tmp/def.sh

Get file contents:

ruexec +/file/get /tmp/log.out

Copy contents of a remote file to a local file:

ruexec +/ssh/mach1/+/file/get /tmp/log.out > ~/log.out

Get segment of file (128 bytes starting at byte 256):

ruexec +/file/gets -s 128 -o 256 -w set /tmp/log.out

Move (may be rename) a file:

ruexec +/file/move /tmp/log.out /tmp/log.out-

Pack select files using tar+gz and save to a file:

ruexec +/file/pack -C /tmp --tgz abc.sh def.sh > scripts.sh

Pack remote files using tar+gz and save to a local file:

ruexec +/ssh/mach1/+/file/pack -C / --tgz tmp > tmp.tgz

Store content to a file:

echo -n "hello world" | ruexec +/file/put /tmp/hello.txt

Write/overwrite file segment:

echo -n "bobby" | ruexec +/file/put -o 6 -w set /tmp/hello.txt

Shrink file:

ruexec +/file/truncate -s 5 /tmp/hello.txt

Extend file (with zero bytes):

ruexec +/file/truncate -s 100 /tmp/hello.txt

Unpack "packed" files:

cat tmp.tgz | ruexec +/file/unpack -C $HOME --tgz

or:

ruexec +/file/unpack -C $HOME --tgz < tmp.tgz

Transfer collection of files:

ruexec +/ssh/mach1/+/file/pack -C / --tgz tmp | ruexec +/ssh/mach2/+/file/unpack -C /tmp --tgz
  • No labels