Posts

Showing posts from July, 2020

rsync - recursive and preserving permissions

Had a case where i need to sync up /hana/data dn /hana/log to a whole new disk.. i used rsync, but f-up the permission part.. so here's a note to myself rsync -rlptgoDHAX <source-dir> <target-dir> You want the -p flag: -p, --perms preserve permissions I tend to always use the -a flag, which is an aggregation of -p and several other useful ones: -a, --archive archive mode; equals -rlptgoD (no -H,-A,-X) -H, --hard-links Preserve hard links -A, --acls This option causes rsync to update the destination ACLs to be the same as the source ACLs. The option also implies --perms. The source and destination systems must have compatible ACL entries for this option to work properly. See the --fake-super option for a way to backup and restore ACLs that are not compatible. -X, --xattrs This option causes rsync to update the destination extended attributes to be the same as the source ones. For systems that suppor...

CSS: Puting Things Dead Center

SOme examples i got from Twitterr: .container {     display: grid     place-iitems: center } {      display: block;      margin: auto; } {      display: flex;      justify-content: center;      align-items: center; } {      width: 50%;      margin: 0 25%; } {      text-align: center; } {      position: absolute;      top: 50%;      left: 50%;      transform: translate(-50%, -50%); } {     margin-left: auto;     margin-righ: auto;     width: 960px; /*example*/ } //alak

VBScript clearner.vbs - Delete File Based on Last Modified Date and Filter by File Extension

A VB script, i forgot where i got it. === '****************************************************************** ' naam: Cleanup.vbs ' function: ' - Cleanup old files depending on the age of x days ' - Check for file extension ' - Possible to recurse in subfolders ' - For clustered drives, will check first if the drive exists on that server ' author: SDR '****************************************************************** Option Explicit Dim wshShell Dim FilePath, Retention, FileFilter, FilterExt, SubFilter Dim fso, Folder, DriveLetter Set wshShell = wscript.createobject( "wscript.shell" ) Set fso = CreateObject( "Scripting.FileSystemObject" ) '******************************************************************* ' Fill in below variables ' ex. ' FilePath = "D:\BACKUP" ' Retention = 2 ' note: Retention is in days ' If you need to filter by extention...