Backup directories with space in directory name

Colin Law clanlaw at gmail.com
Sat Dec 31 16:22:55 UTC 2016


On 31 December 2016 at 16:14, Jack McGee <jack at greendesk.net> wrote:
> On 12/30/2016 11:12 PM, Karl Auer wrote:
>>
>> On Fri, 2016-12-30 at 21:47 -0600, Jack McGee wrote:
>>>
>>> I am trying to use this perl script to backup a directory, but it
>>> fails with this error:
>>
>> You need to protect every expansion point with one set of quotes.
>>
>>> # What to backup.
>>> backup_files="/mnt/ntfs-d/My Documents"
>>
>> That's good. That will keep the path safe *within this script*.
>> However, the variable name is poor, since the value is not a list of
>> files, the value is the name of a directory containing files to back
>> up. Suggest something like "directory_to_back_up".
>>
>> BTW, if you ever want to put more than one directory name into that
>> variable, you will need to do more work than described here.
>>
>> Regards, K.
>>
>
> Thanks all.  It succesfully backed up the My Documents folder, but of
> course, now I want to have it also backup
>
> /usr/local, /var /etc /opt /home
>
> anything else that I would need to restore if I wiped system? Any of that I
> don't?

If you want to backup the whole system you could consider something
like clonezilla which will make a backup of the whole disc for you.

Colin




More information about the ubuntu-users mailing list