NetBackup Windows to Linux Restore: Delete the First N Bytes from a File
In my quest to restore some binaries from a Windows client to a Linux client (an unsupported operation) with NetBackup I had to trim off a 240 byte header from each file to get back the binaries that I had backed up. The easiest way to accomplish this was using dd
's skip parameter:
dd if="$FILE" of="${FILE}.trimmed" bs=240 skip=1
mv "${FILE}.trimmed" "$FILE"
Here I'm setting the block size to 240 bytes, and skipping 1 block into the in file and writing it to a ".trimmed
" version. Then just rename the trimmed version back to its original name.