This is a common error and the reason is your are using Windows to create the file. Thus the line break is \r\n rather than \n.
All you need to do is change the format using a system command:
dos2unix filename_here
An innovative, experienced solutions architect with strong focus on public cloud architecture, solution design and leading technical team. Zhen has 15 years experience designing and implementing a wide spectrum of enterprise level solutions. In the last 4 years, he is committed to evangelising Azure, DevOps and Scrum. His recent focus are enterprise digitisation, cloud governance, reference architecture, IoT, Big Data, Microservices, AWS.
This is a common error and the reason is your are using Windows to create the file. Thus the line break is \r\n rather than \n.
All you need to do is change the format using a system command:
dos2unix filename_here
tar -czf /media/DRIVENAME/BACKUPNAME.tgz /home
This is the real simple solution to backup one folder, and of course, we have more to backup. So, we introduce the following one:'tar -cz - --files-from '+ FILELIST_TAR + ' | split -b 3880m - ' + TAR_OUTPUT+'.tgz'
Re-constitute properly with this customized restore command:
cat /media/DRIVENAME/BACKUPNAME.tgz.* | tar -zxf -
And of course, I didn't forget the windows user, you can re-constitute the files like this:
#!/usr/bin/python
# perform a shell command and get it's output
from commands import getoutput
# perform a shell command and get it's status (error code)
from commands import getstatusoutput
# get exit, and command line args
from sys import exit,argv
#oldPWD=getoutput('pwd')
p1md5=getoutput('(cd "' + argv[1] + '"; find . ) | sort | md5sum -b')
#print p1md5
p2md5=getoutput('(cd "' + argv[2] + '"; find . ) | sort | md5sum -b')
#print p2md5
#getstatusoutput('cd "' + oldPWD + '"')
if p1md5 == p2md5:
print "Success"
exit (0)
else:
print "Fail"
exit (1)