Skip to content

Instantly share code, notes, and snippets.

Baptiste M bmaingret

Block or report user

Report or block bmaingret

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bmaingret
bmaingret / clean_old_files.ps1
Last active Feb 1, 2019
Copy/Move all files that have been modified a few days ago from a source to a daily backup directory
View clean_old_files.ps1
<#
#
.Synopsis
.DESCRIPTION
Copy all files from $sourceDirectory to a directory named $targetDirectory\'yyyy-mm-dd' based on current day that have been modified at least $minimumAgeInDays days ago
Typical usage is the purge of a directory: copy files older than $minimumAgeInDays days to another directory
.NOTES
Created By: Baptiste Maingret
@bmaingret
bmaingret / gist:5402111
Last active Dec 16, 2015
Bash script - saving output to input file for commands like iconv
View gist:5402111
for file in *.php
do
iconv -f cp1251 -t utf8 -o "$file.new" "$file" &&
mv -f "$file.new" "$file"
done
You can’t perform that action at this time.