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
Ready to future-proof your business? Meet NXT Digital, your all-in-one partner for complete digital transformation. We specialise in building custom digital solutions, and support your applications. Don't get left behind—experience the next level of innovation and let NXT Digital transform your vision.
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)