I this thread we post our bash scripts.
Link to this thread when referring to a script.
This will help keep the *nix forum organised.
general instructions for running scripts:
> make exectuable with chmod +x /path/to/script.sh
> run with /path/to/./script.sh
Comments
It's turns out it's reasonable trivial; I've modified some instructions on found on a forum (lost the link)
Here's the script that does it:
How it works:
read the comments. essentially what it does is write two random files, one file is 100meg the other the size of your remaining free diskspace.
It then deletes both; the 100meg file is removed with rm (to quickly free some space for the OS to write logs and other stuff) and the bigger file is removed with shred.
Things to understand:
with the use of the shred utility, each pass is actually going twice. The first is randomising the free space and then the other is randomising the randomised file, replacing it all with zeros and deleting it.
Don't copy stuff onto your disk while this is running. Assume the most disk space you have is 100meg
How to run:
It's a bash script.
> save in home directory as a file called 'wipespace'
> set to executable with chmod +x ~/wipespace
> run with ./wipespace
It will slow your system as it runs. Honestly this is as good as the most expensive commercial apps out there.
you may want to boot into a lower runlevel with: 'sudo telinit 3' before running the script, to get back to a higher run level: 'sudo telinit 5' (or reboot).
If you want to run it without supervision you must boot into a lower runlevel or else your DE will pause the script (at 90% fill for safety) until you click ignore
YOU MUST must have ffmpeg and mplayer installed.
Ideally use the resolution of your desktop, ffmpeg freaks out with a weird resolution.
How to run:
It's a bash script.
> save in home directory as a file called 'recorder'
> set to executable with chmod +x ~/recorder
> run with ./recorder
It just copies all the files to another directory (on my external HDD). If a file hasn't been modified then it is ignored. Also, it auto mounts the backup point so I only have to switch my external HDD on, it backs up, then I turn it off.
You will need to modify it, for it to work with your system.
I run this daily with a cron tab. If I had my external switched on 24/7 then I could even run it hourly.
If I had a big enough hard disk then I'd make it backup to a new directory every hour and hard link files that haven't changed. Just like Time Machine for OSX (which is awesome by the way).
Feel free to suggest improvements, I'm always looking to make things better. :thumbsup: