Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README for EzeeLinux BASH Script Collection - Oct 28, 2017

EazzeLinux Web Page: http://www.ezeelinux.com/

Introduction

    Thanks for downloading the EzeeLinux BASH Script Collection! These 
are scripts that I use on a daily basis and they've been discussed in 
YouTube videos and Facebook posts. You guys have asked for them and now 
they are all available in one happy .zip file. I will offer a brief 
explanation of each one here. Be aware that some will need to be edited 
to fit your specific needs. For instance, SyncIt is an automated scripts 
that uses rsync to sync data between machines on my network and it has 
directories listed that are peculiar to my setup. To use it on your 
system, you will have to setup static IP addresses, install and 
configure SSH to work with security keys and not passwords and you will 
have to substitute your own directories. All of these are designed to 
work with Ubuntu based Linux. They should work just fine with Linux Mint 
or any other distribution based on Ubuntu. They may or may not work with 
other distributions and I have not been tested on

    BASH scripts don't require installation. All you need to do is 
create a directory in your home directory called "bin" (must be 
lowercase) and then you may have to log out and log back in to get the 
system to see it. Any executable file placed in your personal bin 
directory can then be run by typing its name, just like any other 
command, at a terminal. Make sure the script is executable in a File 
Manager and it's ready to use. Keep in mind that scripts in your bin 
will not be seen by the system if you issue them with sudo. The system 
will prompt you if sudo privileges are required.

The Scripts

    Here is a list of the scripts and a bit about what they do:


    SFTPin and SSHin

    These are small scripts that can also be set as aliases or functions 
in your .bashrc file. They work with SSH and make logging into machines 
on your network super easy. You must know the IPv4 address of the 
machine you wish to log into and the script assumes that your LAN is 
using a subnet that uses 192.168.0.xx with the x's standing for the 
specific machine number. Different routers use different schemes so you 
may have to change that. The "$1" represents a variable that contains 
the first argument after the command. So, you would simply type 'sshin 
12' to log into a machine on your LAN that has the address 192.168.0.12. 
The command 'sftpin 12' would open the SFTP file transfer program and 
you can use it to move move file from one machine to another just as you 
would use a public FTP server.

    SyncIt

    This script also works with SSH and let's you sync directories 
across a network. The rsync command used here will make an exact copy of 
whatever is in the local machine's directories on a remote machine. 
Files that have changed or have been added to the local machine will be 
copied or updated on the remote machine. Files that have been deleted 
locally will be removed from the remote host, as well. WARNING! This 
script will also remove files that are on a remote machine that do not 
exist in the local machine you're sending from! It makes an exact copy 
of whatever is in the directory being synced so if you have files on the 
remote machine you want to keep that it's not a good idea to run SyncIt 
before using SFTPin to grab those remote files and make sure they are on 
the local machine first! The directories in the script are the ones I 
have chosen to sync but a bit of editing will make it work for you. Make 
sure that all the IP addresses match your network scheme. Just as in the 
scripts above, the way to issue a SyncIt command is: 'syncit 12' We'er 
assuming here that the machine you're wanting to sync to has the IP 
address 192.168.0.12.

    Up

    This is a simple script that automatically checks for updates and 
then installs them. It also removes any orphaned programs that the 
system no longer needs and cleans the apt cache. Packages that are no 
longer available in the repositories are removed from the local apt 
cache to reclaim hard drive space and keep the local cache's size down. 
Up will work on any Debian/Ubuntu system but care should be taken when 
using it on Linux Mint because kernels will NOT be updated with this 
script. The Mint Update tool must be used for that task.

    XBT

    This script should work on a wide variety of Linux distributions. 
You must have a USB drive that is formatted with a Linux compatible file 
system, such as ext4, and it must be set so you have permissions to 
write to it. It will make an incremental back up of your entire /home 
directory on the USB drive so that drive must have enough space to store 
all user data on the system. This is one you should't need to edit but 
there is extensive documentation included in the script itself so be 
sure to take a look at in your favorite text editor.

    Z-Clean and Z-Defrag

    These are Anacron wrapper scripts that work with the Anacron 
scheduling system. You use them by copying them to one of three 
directories on an Ubuntu based system. (Anacron may or may not be 
configured on other Linux distributions. Check the documentation to find 
out before adding these scripts.)  Those directories are: 
/etc/cron.daily /etc/cron.weekly /etc/cron/monthly. Any script placed in 
these directories will run periodically in the background on your 
machine. They must be written for sh and there is a specific format so 
be cautious when editing them. Feel free to change the parameters of the 
commands and also these can be used as templates for commands you'd like 
to have run automatically. They begin with a Z to ensure that they're 
the last scripts to run. This way they will not conflict with system 
scripts that may already be in the Anacron directories. Anacron has 
several advantages over regular cron and you should take time to read 
some documentation before you start playing around with it. The manual 
page is well written and you can access it with the 'man anacron' 
command in a terminal.

    Conclusion

    Have fun with these! Feel free to do with them as you will but keep 
in mind that I have not tested them on every other Linux distribution 
available and I cannot offer support to you if they don't work on yours. 
I would love to hear your comments and I will happily look at any 
suggestions for new features or code fixes but I do not have the time or 
inclination to run and test your modified versions, act as a beta tester 
or even offer useful advice if your changes are not working. I am NOT an 
expert; I am simply sharing tool that I use everyday.

    :)

    Joe Collins


Please be sure to give EzeeLinux a 'Like' on Facebook! Thanks! 
https://www.facebook.com/EzeeLinux Check out http://www.ezeelinux.com 
and http://www.freedompenguin.com for more about Linux. YouTube: 
https://www.youtube.com/user/BadEditPro


THIS SOFTWARE IS PROVIDED BY EZEELINUX "AS IS" AND ANY EXPRESS OR 
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
DISCLAIMED. IN NO EVENT SHALL EZEELINUX BE LIABLE FOR ANY DIRECT, 
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.