Set the directory used to archive cleaned up log files, also enabling
archiving.
353477
public JournalBuilder setArchived(File to) {
        if (!to.exists()) {
            throw new IllegalArgumentException("<" + to + "> does not exist");
        }
        if (!to.isDirectory()) {
            throw new IllegalArgumentException("<" + to + "> is not a directory");
        }
        this.directoryArchive = to;
        return this;
    }
457422
private void executeArchive() {
        for (AbstractArchiveJob archiveJob : jobs) {
            archiveJob.setArchiveDateDiff(extractArchiveDateCount(archiveEnv.getDatePattern()));
            archiveJob.setPath(archiveEnv.getDirPath());
            archiveJob.setCompressionExtention(archiveEnv.getCompression().getExtention());
            archiveJob.archive();
        }
    }
660537
def set_up_dirs(proc_name, output_dir=None, work_dir=None, log_dir=None):
    
    output_dir = safe_mkdir(adjust_path(output_dir or join(os.getcwd(), proc_name)), 'output_dir')
    debug('Saving results into ' + output_dir)

    work_dir = safe_mkdir(work_dir or join(output_dir, 'work'), 'working directory')
    info('Using work directory ' + work_dir)

    log_fpath = set_up_log(log_dir or safe_mkdir(join(work_dir, 'log')), proc_name + '.log')

    return output_dir, work_dir, log_fpath
429817
def clean(ctx, dry_run=False):
    """"""
    # -- VARIATION-POINT 1: Allow user to override in configuration-file
    directories = ctx.clean.directories
    files = ctx.clean.files

    # -- VARIATION-POINT 2: Allow user to add more files/dirs to be removed.
    extra_directories = ctx.clean.extra_directories or []
    extra_files = ctx.clean.extra_files or []
    if extra_directories:
        directories.extend(extra_directories)
    if extra_files:
        files.extend(extra_files)

    # -- PERFORM CLEANUP:
    execute_cleanup_tasks(ctx, cleanup_tasks, dry_run=dry_run)
    cleanup_dirs(directories, dry_run=dry_run)
    cleanup_files(files, dry_run=dry_run)
1308103
protected function reopenArchive()
	{
		$path = $this->archive->filename;
		$this->archive->close();
		$this->openArchive($path);
	}
1014235
private void cleanupBackupDir(int keep) {
        File[] backupDirFiles = getSortedBackupDirFiles();
        if (backupDirFiles.length > keep) {
            for (int i = keep; i < backupDirFiles.length; i++) {
                backupDirFiles[i].delete();
            }
        }
    }
1044370
public void setWorkingDirectory(Path dir) {
    if (!dir.isAbsolute()) {
      FileSystem.LogForCollect
          .info("set job working directory to non absolute path: " + dir
              + " working directory: " + getWorkingDirectory());
    }
    dir = new Path(getWorkingDirectory(), dir);
    set("mapred.working.dir", dir.toString());
  }
391956
def set_asset_dir(self):
        
        log = logging.getLogger(self.cls_logger + '.get_asset_dir')
        try:
            self.asset_dir = os.environ['ASSET_DIR']
        except KeyError:
            log.warn('Environment variable ASSET_DIR is not set!')
        else:
            log.info('Found environment variable ASSET_DIR: {a}'.format(a=self.asset_dir))
17845
public void setArchiveStatus(com.google.api.ads.admanager.axis.v201805.ArchiveStatus archiveStatus) {
        this.archiveStatus = archiveStatus;
    }
71984
public function setLogsDir(string $logsDir): void
    {
        if (!file_exists($logsDir) || !is_writable($logsDir)) {
            throw new LoggerException('Logs path does not exist or is not writable.');
        }
        $this->logsDir = rtrim($logsDir, '/') . '/';
    }
638784
protected void cleanUpArchiver( AbstractArchiver archiver )
    {
        try
        {
            Method cleanUpMethod = AbstractArchiver.class.getDeclaredMethod( "cleanUp" );
            cleanUpMethod.setAccessible( true );
            cleanUpMethod.invoke( archiver );
        }
        catch ( Exception e )
        {
            getLog().warn( "\"" + e.getMessage() + "\" exception while invoking AbstractArchiver.cleanUp() using reflection. Ignoring." );
        }
    }
1284635
def purge_archives(base_dir: str, retain_latest: bool = False) -> None:
        

        LOGGER.debug('purge_archives >>> base_dir: %s, retain_latest: %s', base_dir, retain_latest)

        if isdir(base_dir):
            timestamps = sorted([int(t) for t in listdir(base_dir) if t.isdigit()])
            if retain_latest and timestamps:
                timestamps.pop()
            for timestamp in timestamps:
                timestamp_dir = join(base_dir, str(timestamp))
                rmtree(timestamp_dir)
                LOGGER.info('Purged archive cache directory %s', timestamp_dir)

        LOGGER.debug('purge_archives <<<')
1237819
def _cleanup_tempdir(tempdir):
    """"""
    try:
        shutil.rmtree(tempdir)
    except OSError as err:
        if err.errno != errno.ENOENT:
            raise
522596
def setup_dirs(self, storage_dir):
        ''''''
        self.storage_dir = expanduser(storage_dir)
        if ' ' in self.storage_dir:
            raise ValueError('storage dir path cannot contain spaces, please '
                             'specify a path with --storage-dir')
        self.build_dir = join(self.storage_dir, 'build')
        self.dist_dir = join(self.storage_dir, 'dists')
1280840
def set_dir(self, dir_):
        """"""

        self.__lock_set_dir(dir_)
        self.__lock_auto_load()
        self.__lock_update_table()
        self.__update_info()
        self.__update_window_title()
36603
def auto_set_dir(action=None, name=None):
    
    mod = sys.modules['__main__']
    basename = os.path.basename(mod.__file__)
    auto_dirname = os.path.join('train_log', basename[:basename.rfind('.')])
    if name:
        auto_dirname += '_%s' % name if os.name == 'nt' else ':%s' % name
    set_logger_dir(auto_dirname, action=action)
1149285
def register_rmtree(directory, cleaner=_mkdtemp_atexit_cleaner):
  """"""
  with _MKDTEMP_LOCK:
    _mkdtemp_register_cleaner(cleaner)
    _MKDTEMP_DIRS[os.getpid()].add(directory)
  return directory