![]() So if we add our updater.sh script to the crontab all we have to do is add files to ~/scripts/sysupdates and they will get run automatically. Cron is a program that runs a given script at a specified interval. The last part of this to edit the root crontab. It only takes a minute and will save headaches down the road, remember you may not remember why you created it later or what it did, or it may not be you who has to maintain it one day. # Purpose: run update scripts from ~/scripts/sysupdatesįor SCRIPT in `ls ~/scripts/sysupdates` do $ doneĭo yourself a favor and get in the habit of making proper header for each file you create. # Date: yyyymmdd - ee (ee = times edited) postfix, qmail, update) then you can loop through them with one script in ~/scripts which can be something like: #/usr/bin/bash If you create the files for what you want to update as mentioned above (eg. This also has the purpose of limiting our entries in other places, as you will soon see. ![]() This mirrors the function of other *nix systems like init.d and will make maintaining the system easier and intuitive. If you are going to utilize a number of these files I would create a special dir for them like ~/scripts/sysupdates and try to keep each file to doing only one thing. The trick is to try to write code that is reusable and thereby make your life easier. It is always a good idea to keep a scripts directory of some sort to house the little scripts that you use to manage your system(s) over time you will end up with quite a few and every administrator has his/her "toolbox" that they keep for these things. Something like this is usually best kept in ~/bin or ~/scripts so if it doesn't exist you may need to create it and than verify that the new home is part of your PATH. The best practice concerning what you want to accomplish is to become root sudo su - and then work in the /root user dir. You can remove hold any time from package to allow upgrade again.This is best automated by the root/admin account and not left in the files of a standard user. In this tutorial, you have learned to hold packages from unnecessary upgrades. Now, the unhold packages will be upgraded with apt upgrade or unattended upgrades.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |