close

Programming

Windows Server

PS Script For Scanning And Removing Files With Extension And Retention

– Download script at github link: 

https://github.com/vominhtri1991/PS_scanning_clearing_files_retention.git

– Structure  for running this script:

clear-files-retention.ps1 <path for scanning file> <retention days for keep file> <extension of files nedd to check>

– When running this script need passing enought 3 arguments if missing any argument script will exising without actions 

– If passing all requriment argument, in next step script will list again all value for checking and prompt Yes/No confirm to continue

– Choose Y and script will scanning and removing files with condiontion passing to arguments. List of file removed will be logged in file:

C:/tmp/clearfiles-ddMMyyyy-HHmm.log

Shell Script

Bash Script For Scanning And Removing Files With Extension And Retention

– Download script at github link: 

https://github.com/vominhtri1991/bash_scanning_clearing_files_retention.git

– Copy this script to /usr/local/bin

– Structure  for running this script:

clear-files-retention <path for scanning file> <retention days for keep file> <extension of files nedd to check>

– When running this script need passing enought 3 arguments if missing any argument script will exising without actions 

– If passing all requriment argument, in next step script will list again all value for checking and prompt Yes/No confirm to continue

– Choose Y and script will scanning and removing files with condiontion passing to arguments. List of file removed will be logged in file: /var/log/clear-files-ddmmyyy:hour:minute.log

Shell Script

Building Bash Script To Run SFTP As Batch Mode

SFTP Running as batch mode reads a series of commands from an input batchfile instead of stdin and execute each line one by one.

Buliding bash script to run sftp bach mode for syncing files to remote server. Script also has function to logging result of running job and listing all files already sync with below format

– Download script at my github:

https://github.com/vominhtri1991/sftpsync_logging.git

Note: Configure ssh using key authentication between local and remote server before running script to sync files.

error: Content is protected !!