I'm writing a shell script to compress and backup certain files. This will compress and move large files with sizes up to 4 GB.
I'm having trouble with this line:
gzip < $filelocation > $backuplocation
Where
$filelocation = /home/user/image.img
$backuplocation = /home
And I will add a similar line to decompress the file
gunzip < $filelocation > $backuplocation
Now it doesn't work for some reason.
I try gunzip $filelocation > $backuplocation
Will I be able to pipe it and move the compressed file instead into the directory?
$filelocation
and$backuplocation
are might help. What error message do you get? What exactly do you mean by "it doesn't work for some reason"? – roaima Mar 21 at 14:57code./backup.sh: line 28: /home: Is a directory
. Check my edit to see the paths specified. – Bruce Strafford Mar 21 at 15:01