BASH SHELL SCRIPTS FOR LINUX

Linux Software Packages

MaxMenu

Why not Windows?

A COLLECTION OF AUTOMATION SCRIPTS FOR LINUX

1: COPY AND RENAME PHOTOS TO DATE/TIME FORMAT FOR EASY ARCHIVING

photo-copy-rename

Left click to view / Right click to download.

Version: 101123-01

Description: This script copies graphics files from a
media storage device, card reader, or just any directory,
tries to mount the media, then renames all files to
year-month-day-hour-minutes-seconds-(A/B/C) format,
and creates a year/month/day directory sructure
whereto these files will be copied. Supported graphics
formats are jpg, tif, nef, crw, cr2. The files must
contain an EXIF date-tag, it is used for renaming
the files.

How do I install this ?

How do I run this ?

Run this command from a Terminal Window:

photo-copy-rename

You will be asked to specify the source and destination
folders. The folder settings are saved in
~/.photo-copy-rename. You can also specify source and
destination folders as an option: Run
"photo-copy-rename source_folder destination_folder"
from the command line. Replace the source_folder
with the folder where the original photos reside, and
replace destination_folder with the name of the
folder to where you want the photos to be saved.

Requires: This script requires certain packages to
ensure correct execution: coreutils, (perl-)Image-ExifTool

Latest update 101123: Fixed unneccesary creation of empty target directories.




2: BACKUP SCRIPT. USES MIDNIGHT COMMANDER. CAN ALSO BE RUN BY CRON

system-make-backup

Left click to view / Right click to download.

Version: 080516-1233

Description: This script creates a backup TAR archive of modified files
from RPM or Debian packages. You can specify additional files
or folders to backup, from within the Midnight Commander menu.
Handy if you want to carry your config files around ALL the time.

How do I install this ?

How do I run this ?

Run this command from a Terminal Window, AS ROOT:

system-make-backup --bkpdir "/path/to/backup/folder"

Replace "/path/to/backup/folder" with the location of
the folder to which you want your backups to be saved.

All changed configuration files from your installed
.deb or .rpm packages will be backed up. You can also
manually specify a list of to be backed up files with
Midnight Commander (mc).

The first time the script runs, the Midnight Commander
menu entries will be created. After that you can select
the files/folders that you want to backup from within
Midnight Commander: just select one or more files/folders
with the "Insert" key, then press "F2" and select:

"Mark (current/tagged) file(s) for backup"

A list of files/dirs that you want to backup will then
be created in "/etc/make-backup". If this list is created
you can run the script any time to make a backup archive.

The script is also suitable to be run as a cron
job, making scheduled backups a possibility.

Requires: This script requires certain programs to
ensure correct execution: tar, rpm, debsums, mc




3: SERVER PROCESS MONITOR/RESTARTER

net-server-monitor

Left click to view / Right click to download.

Version: 080325-1800

Description: This script can check continuously
if certain server daemons are running. If not
they will be restarted. A message will be mailed
to the specified adress as defined in $MAILME.
If $MAILME is empty, then mail will be sent to
root. $SLEEP will set the frequency of the checks.
The script will test for certain distributions,
set up logging, and checks if services do not
conflict with (x)inetd while restarting.

How do I install this ?

How do I run this ?

Run this command with one or more options from a Terminal Window:

net-server-monitor apache2 sshd &

or put such a line in one of your startup scripts.

Supported options are:

apache2 proftpd samba sshd xinetd

Requires: This script requires the netstat program to run.

Note: Script output is in DUTCH LANGUAGE!
Script logic is straightforward so you could
translate yourself.
Latest update 110722: Changed redhat and debian startcommands from
"/etc/initdir/service start" to "service service start"
for better compatibility.




GENERAL INSTALLATION INSTRUCTIONS

Installing a script requires some command line
action, which is really not all that difficult.

Download the script and save it in your home folder "/home/user"
(replace "user" with the name of your user account)

Open a Terminal Window and issue the following
commands (hit Enter after typing a command):

chmod +x ~/name-of-script
mv -f ~/name-of-script ~/bin/

or when you want to copy it as root, type:

sudo mv -f ~/name-of-script /usr/local/bin/

Substitute "name-of-script" with the name of the script
you just downloaded. Sudo will ask you for your user password.

If you don't have a "/home/user/bin" folder
you can create it by issuing this command:

mkdir ~/bin

The tilde is a substitution for "/home/user"

If all went well you can start a script by typing it's name
and maybe some startup options in a terminal like this:

sudo name-of-script option1 option2

If you need to run a script as root you can use the sudo command:

sudo name-of-script option1 option2

Sudo will ask you for your user password.




All scripts are currently written and tested on Ubuntu Lucid 10.04.

Everything is released under the GNU GENERAL PUBLIC LICENSE