WIN 7 ili 10 i BATCH skripta (i Task Sheduler)

Šta koristiti za kopiranje samo novoizmenjenih fajlova sa jednog na drugi folder (drugi je mountovan i nalazi se na backup lokaciji).
Probala sam xcopy ali ima bagova, a ima i ograničenja.
Robocopy je bolji izbor.

Dakle moj batch fajl test1.bat :
echo oooooooooooooooooooooooooooo >> kopiranje.txt
robocopy “D:\Moja Dokumenta\Testiranje” Z:\TEST test*.txt /e /xo /tee /log+:kopiranje.txt
echo oooooooooooooooooooooooooooo >> kopiranje.txt

:: /xo – copy only newer files
:: /e – copy folders recursively
:: /tee – log output to CLI
:: /log+ – dodaje na vec postojeci log bez prepisivanja

I kako poslati mail posle kraja zadatka (isto u test1.bat fajlu), zajedno sa log fajlom :
:: slanje mail poruke
:: slanje mail poruke
powershell -ExecutionPolicy ByPass -Command Send-MailMessage ^
-SmtpServer 10.10.10.10 ^
-To velda.midanovic@moj.domen ^
-From velda.midanovic@moj.domen ^
-Subject testXXXXX ^
-Body testXXXXX ^
-Attachments ‘D:\Moja Dokumenta\Testiranje\kopiranjeXXXXX.txt’

Napomena : source folder MORA da se navede pod duplim navodnicima, jer drugačije neće da radi kroz Task Sheduler (radi kada se skripta pušta ručno).

Problem nastaje kada pokušam da ga stavim u WIN 10 Task Sheduler da se obavlja automatski, pošto mi to ne uspeva.
Evo šta sve treba podesiti (dobar link) :
From Windows Task Scheduler on the job Properties :
1. General tab :
Uncheck Run only when user is logged on
Check Run whether user is logged on or not
Check Run with the highest privileges
2. Conditions tab :
Check Wake the computer to run this task
3. Actions tab, click Edit, and ensure that the “Start in” is set with NO double quote marks around the full path pointing where the batch script is located WITHOUT a final backslash “\”.

Zakođe iz misterioznih razloga kada se skripta pušta kroz Task Sheduler (a ne ručno) NE PREPOZNAJE mapirane diskove, tako da ih moramo navesti sa punom putanjom : \\storage\folder1\folder2\folder3\folder4.

Razni izlazi iz robocopy komande
“Tweaked” A Tweaked file is defined to be one that exists in both the source and destination, with identical size and timestamp, but different attribute settings.
“Lonely” A “lonely” file is present in source but not destination; excluding lonely will prevent any new files being added to the destination.
“Extra” An “extra” file is present in destination but not source; excluding extras will prevent any deletions from the destination. “Extras” will be removed if you’re using options like PURGE and MIR.
“New Dir” represents a folder that existed on the source but not in the target, and “Extra Dir” represents a folder that existed in the target that wasn’t in the source.
“New File” and “Extra File” are the same thing, only for files. 🙂

Moguće greške
Ako pokušate da definišete zadatak u Task Sheduler-u, i javi vam se greška :

To se rešava dodeljivanjem adekvatnih prava :

Windows Chocolatey

Šta je ovo i čemu služi
Chocolatey is a package manager for windows.
A package manager can download, install, remove, or upgrade apps from various places around the web without forcing you to leave the comfort of your desktop screen.
Package managers allow you to:
*Download and install software without having to go to different web pages.
*Verify packages have not been tampered with so that you don’t end up with malware from MITM attacks.
*Install multiple packages for you and even make sure to install other software that an app may require.
*Upgrade and remove packages
*Search for packages.

Instalacija
Odličan link za instalaciju.
By default, Chocolatey installs itself to a folder in C:\ProgramData, a hidden windows folder that requires the Windows Administrator role to access.
1. Run PowerShell as Administrator
2. Set execution policy with : Set-ExecutionPolicy Unrestricted -Force -Scope Process
Napomena : ovo važi samo za ovu PS sesiju.
3. Download and Install Chocolatey : in PO :
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
4. Proveriti verziju kroz PS :
choco –version
Napomena : ovo je instaliralo CLI verziju. Ako hoćemo GUI (a hoćemo!), idemo dalje.
5. GUI instalacija, u PS :
choco install ChocolateyGUI -y
6. Proveriti GUI instalaciju sa : choco list -1
Dobija se ovo :
chocolatey 0.10.11
chocolateygui 0.16.0
Napomena : CLI instalacija ima SVE opcije, GUI verzija je siromašnija.

Dodatne radnje
Ako koristite Python, obavezno ga treba dodati u PATH! Obično je u C:\Python37\Scripts (videti gde se nali pip.exe fajl).

RedMine crtice

Kako postaviti grafik u Wiki :
1. Mora biti slika (jpg, png)
2. Otvori se stranica za edit
3. Upload-uje se slika
4. Na stranici gde hoćete sliku staviti : !{width:700px}ime-slike.png!
5. Dimenzije slike podesite kako hoćete. Na većim ekranima “700px” meni funkcioniše odlično, slika je taman velika da se sve lepo vidi, a ne uzima ceo ekran.
Domar link.

Kako linkovati ka dokumentu koji je upload-ovan na Wiki stranu :
“Ovde ide tekst linka”:https://imeservera.imedomena/attachments/download/XXXXX/imedokumenta.ekstenzija
Gde je :
XXXXX – redni broj dokumenta, koji se vidi kada se dokument upload-uje, i onda se pointerom miša “lebdi” iznad dokumenta
imedokumenta – ako sadrži blanko znake, umesto njih treba staviti %20
Napomena : ako vam trebaju i predhodne verzije dokumenata, obavezno koristiti DMSF opciju

Dobar link ka generalnim pravilima formatiranja za Wiki u RedMine-u.

Oracle i Enterprise Manager Cloud Control 13c

Kroz ovo se prate mnoge korisne stvari, od backup-a (urađen/neurađen, tip, veličina itd) do stanja nad tablespaces.
I to zadnje je pomalo problem.
Kad se pogleda pod “Tablespaces” dobijaju se ovi podaci :

Problem je u tome šta koja kolona predstavlja :
Name – ime tablespace-a
*****
U čemu je razlika između ova dva :
Available Space Used (%) – allocated space-allocated space that is still not in use
Basically how much of the allocated space is actually in use.
This is the metric on which alerts are generated.
Allocated Space Used (%) = (space used*100%)/allocated size
The allocated space of a tablespace is the sum of the current size of its data files.
A portion of this allocated space is used to store data while some may be free space.
The allocated free space is only available to segments within this (designated) tablespace.
It is not intended to generate alerts.
*****
Auto Extend – sam sebe proširuje 🙂
Space Used (MB/GB/TB) + Allocated Free Space (MB/GB/TB) = Allocated Size (MB/GB/TB)

Moj predhodni post sa sličnom temom.
Link

Griz koh

Fenomenalan softni i sočan kolač koj se brzo i lako pravi 🙂

Testo :
6 jaja (odvojiti žumance i belance)
1/2 prašak za pecivo
3 supene kašike brašna
6 supenih kašika griza
2 supene kašike šećera u prahu
Preliv :
1,5l mleka
6 supenih kašika šećera
Priprema preliva :
Zagrejati mleko sa šećerom da prostruji, pa ostaviti lonac pored.
Priprema testa :
Umutiti žumanca, prašak za pecivo, brašno i griz u jednoj posudi.
U drugoj posudi umutiti čvrsti sneg od belanaca i polako mu dodati 2 kašike šećera u prahu.
Šne polako dodati u testo, uz lagano mešanje.
Tepsiju namazati uljem i sipati testo.
Testo peći na 180C u predhodno zagrejanoj rerni.
Još vruće testo preliti mlekom.
Posuti prah šećerom po želji.
Pustiti da se ohladi, pa staviti u frižider.
MLJAC 🙂