Jun/092
Linux: nohup: Execute a command after exiting a shell
This is quite useful. I used to push jobs to the background and then exit shell, but it wasn’t an easy task considering I have short term memory issues (not a complete retard, just too much on my mind
). I found this awesome little command to have the commands or scripts run right after I’m off the wagon!
nohup
That’s it… simply run your comman with it:
nohup command
Don’t forget the ampersand at the end. Use absolute path for scripts:
nohup ~/script &
If your scripts requires additional options to run, use a quote right before the ampersand:
nohup ~/script "start" &
Note that you don’t need to use this for your wget command… wget comes with a built-in switch (b):
wget -b
Have fun!
Jun/090
Linux: Convert .bin/.cue images to .iso
Install bchunk, then:
bchunk filename.bin filename.cue filename.iso
To mount:
mount -o loop filename.iso mountpoint
Jun/092
Linux: View and manage processes running in the background
To view all processes:
ps aux
Search for a process by name:
pgrep <string> | xargs ps
To view all processes, line by line (hit enter to view the next process, hit q to exit):
ps aux | less
To view every process:
ps -A or ps -e
All processes running by a user:
ps -u username
All processes except the ones running by root:
ps -U root -u root -N
To kill a process, either find the process name and type:
kill -9 processname
or kill the process ID (PID):
kill pid
Stop/suspend a process:
ctrl-z
Push a job to run in the background:
fg pid
May/093
Backup Exec: Transfer scheduled jobs, database and settings to a new backup server
My db server crapped out so I’ll have to retype the whole darn thing
Well… it’s quite easy especially if you are keeping the same server name (skip the SQL commands below and go right to transfer section). If not you will have to change your SQL instance name accordingly.
Start here if you’re changing the server name, otherwise skip the SQL commands below:
Open command prompt and type the following:
osql -E -S servername\BKUPEXEC use bedb press enter UPDATE DataPartition SET PartitionName='SERVERNAME' WHERE PartitionID = 0 press enter SELECT partitionname FROM datapartition press enter go press enter
Then proceed with tranferring your db over to the new server. Two folders under Backup Exec installation folder are needed: Data and Catalogs. After backing up your current folders:
- Stop all Backup Exec services. I’d open the console and go to Tools – Backup Exec Services and stop all.
- Stop all SQL services in services console.
- Copy the above folders to your new server and overwrite all existing files.
- Run BEUtility.exe under Backup Exec folder. You will be prompted not to use the utility without supervision… right! Just click it away.
- In the left pane click on All Media Servers, and in the right pane right click on your server name and click Copy Database.
- Browse to bedb_data.mdf (database file) and bedb_log.ldf (database log file) you just copied over from the old server.
- Click OK and proceed with the transfer.
BEUtility will transfer your settings and detach/attach your database and start your BE services automatically. If not then start them manually.
If you don’t see an error message about unsuccessful db detach/attach and your services start in timely fashion then you should be able to see all your jobs, media, devices and even settings and encryption keys transferred to the new server.
Apr/095
Linux: df: cannot read table of mounted file systems
“df -l” returned an error: “df: cannot read table of mounted file systems”. I looked at my “/etc/mtab” file – empty! I did a “fdisk -l” and saw my partitions there, then proceeded to create a new mtab from my /proc/mount:
grep -v rootfs /proc/mounts > /etc/mtab
Error message: no space left on the device!
Ran out of room… my SQL dumps are taking a lot of space
Freed up some space and executed the command again – df is now returning what it’s supposed to return.