archivePath: Move a file or folder to a new location, ensuring it has a...

Description Usage Arguments Value Author(s) See Also

Description

Some files such as SG system logs and unhandled files are stored into folders, possibly for later manual processing.

Usage

1
archivePath(path, newdir)

Arguments

path

vector of paths of files to save, or a scalar path to a folder to be saved. If this is a folder whose name already begins with a timestamp, it is simply moved to newdir

newdir

directory in which to create a timestamped folder which will hold path (if it's a file) or the contents of path, if it's a folder. The directory newdir is created, if necessary.

i.e.

myfile -> newdir/YYYY-MM-DDTHH-MM-SS.SSSSSS/myfile ## when path is a file mydir/* -> newdir/YYYY-MM-DDTHH-MM-SS.SSSSSS,mydir/* ## when path is a folder

or, when path is a folder whose name begins with a timestamp:

2016-07-30T02-12-23.123455,mystuff/* -> newdir/2016-07-30T02-12-23.123455,mystuff/*

This means the basename of path is preserved, either as the destination filename, or as part of the destination folder name. This makes it easier to trace the origin of the folder from the server mainlog.

Value

TRUE iff the file or folder was successfully archived

Author(s)

John Brzustowski jbrzusto@REMOVE_THIS_PART_fastmail.fm

See Also


jbrzusto/motus-R-package documentation built on May 18, 2019, 7:03 p.m.