Knowledge Base

Simple backup script (daily)

Call the script “backup_daily.cmd” and run it on weekdays.  You don’t have to run it each day; you can run it only on saturdays or every other day; you decide.  It will save data in the following folders:

1_Monday
2_Tuesday
3_Wednesday
4_Thursday
5_Friday
6_Saturday
7_Sunday

Each time the script is run, the appropriate weekday folder will be overwritten.

Note: You will need a longer term backup job as well, as after 1 week you can no longer restore files you deleted more than a week ago.

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: If site uses multiple HDDs for backup rotation:           ::
::   - only connect one HDD at a time to retain drive letters::
::   - make sure they all are assigned the same drive letter ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off
SETLOCAL

:::::::::::::
:: Weekdays ::
::::::::::::::

for /f "tokens=1" %%i in ('date /t') do set shortday=%%i
if %shortday% == Mon set today=1_Monday
if %shortday% == Tue set today=2_Tuesday
if %shortday% == Wed set today=3_Wednesday
if %shortday% == Thu set today=4_Thursday
if %shortday% == Fri set today=5_Friday
if %shortday% == Sat set today=6_Saturday
if %shortday% == Sun set today=7_Sunday

::::::::::::::::::::
:: Site Variables ::
::::::::::::::::::::

set usb=F:
set dest=%usb%\Backup\%today%
set switches=/E /NP /NFL /tee /R:1 /W:1 /MIR /COPYALL
set robocopy=%windir%\system32\robocopy.exe

::::::::::::::::::::
:: Initialization ::
::::::::::::::::::::

if not exist "%usb%"  exit
if not exist "%dest%" md "%dest%"

:::::::::::::
:: Backup  ::
:::::::::::::

"%robocopy%" "c:\folder1" "%dest%\folder1" %switches% /LOG:"%dest%\backup_folder1.log"
"%robocopy%" "c:\folder2" "%dest%\folder2" %switches% /LOG:"%dest%\backup_folder2.log"
"%robocopy%" "c:\folder3" "%dest%\folder3" %switches% /LOG:"%dest%\backup_folder3.log"

:End
ENDLOCAL
:Exit

Simple backup script (daily) was last modified: March 20th, 2015 by tabcom

Simple Backup script (mid to long term)

Call the script “backup_manual.cmd” and run it once a week, once a term or once a year if you like.  It will save data in a ‘year’ folder i.e. “2015” which will be overwritten each time the script is run.  The next year, it will start overwriting next year’s folder.

Note: You will need sufficient free space on your USB hard disk as each year a new backup set is created.

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: If site uses multiple HDDs for backup rotation:           ::
::   - only connect one HDD at a time to retain drive letters::
::   - make sure they all are assigned the same drive letter ::
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

@echo off
SETLOCAL

::::::::::::::::::::
:: Site Variables ::
::::::::::::::::::::

set usb=F:
set year=%date:~10,4%
set dest=%usb%\Backup\%year%
set switches=/E /NP /NFL /tee /R:1 /W:1 /MIR /COPYALL
set robocopy=%windir%\system32\robocopy.exe

::::::::::::::::::::
:: Initialization ::
::::::::::::::::::::

if not exist "%usb%"  exit
if not exist "%dest%" md "%dest%"

:::::::::::::
:: Backup  ::
:::::::::::::

"%robocopy%" "c:\folder1" "%dest%\folder1" %switches% /LOG:"%dest%\backup_folder1.log"
"%robocopy%" "c:\folder2" "%dest%\folder2" %switches% /LOG:"%dest%\backup_folder2.log"
"%robocopy%" "c:\folder3" "%dest%\folder3" %switches% /LOG:"%dest%\backup_folder3.log"

:End
ENDLOCAL
:Exit
Simple Backup script (mid to long term) was last modified: March 18th, 2015 by tabcom

Newsletters (or the use of HTML in emails)

There are a few rules to keep in mind when creating an HTML email:

    • HTML fixed width tables should be used for layout.  Using div tags may work, but is not recommended as this is more suited for dynamic rather than fixed page layouts.
    • You can use CSS for inline elements such as background colors and fonts styling.
    • You can use CSS img tags for images.  Use absolute links like “http://…” and not relative links like “/images/…”
    • Give your images alt attributes; it’s absolutely vital in HTML emails.  By default, many email clients do not display images when an email is first opened. Instead, they ask users to actively choose to display images.
    • Remember to wrap each block of text in span tags.  This allows you to specify formatting styles.  Set the font-family to arial, sans-serif; and the color to black.

Example

<table style="border-left: 2px solid #e6e6e6; border-right: 2px solid #e6e6e6;" cellspacing="0" cellpadding="25" width="605">
<td width="596" align="center" style="background-color: #ffffff; border-top: 0px solid #000000; text-align: left; height: 50px;">
<p style="margin-bottom: 10px; font-size: 22px; font-weight: bold; color: #494a48; font-family: arial; line-height: 110%;">
Newsletter - Your monthly source of information</p></td>
<tr>
<td style="background-color: #ffffff; border-top: 0px solid #333333; border-bottom: 10px solid #FFFFFF;" align="middle" valign="middle">
<a href="#"><img src="http://mywebsite.com/images/banner.jpg" border="0" alt="Banner Image" align="center" /></a></td>
<tr>
<td style="background-color: #ffffff; border-top: 0px solid #000000; text-align: left; height: 50px;" align="center">
<p><span style="margin-bottom: 10px; font-size: 12px; font-weight: normal; color: #494a48; font-family: arial; line-height: 110%;">Paragraph text here!</span></p>
<p><a href="link" style="font-family: arial"><span style="font-family: arial; font-size: 12px; color:#b0589d">Link -&gt;</span></a></p>
<p><a href="#"><img src="http://mywebsite.com/images/spacer.jpg" border="0" alt="Frog on a log" align="center" /></a></p> </tr> </table>

The result would look something like this:
(Note: images are not shown as the website address used -‘http://mywebsite.com’- is not real)

newsletter

Newsletters (or the use of HTML in emails) was last modified: March 18th, 2015 by tabcom