Hi,
I ran into “issues” with my asset store when I switched computers and/or installs of different versions of U3D. ( I am a U3D 5 Beta person
)
So I thought I should share my findings.
Basically a plain simple tar on ~/Library/Unity will not work, as there are spaces and other special characters in the path. Note: The assets are stored under the company names including those special chars.
In addition I wanted to have a timestamp on the back up.
First I though that I should use the tar “c” flag, but I think that is overkill as all *.unitypackage(s) are already compressed and it will just add time to the backup, but not save any notable space. In that first run I ended up with 12G as a tar archive. Rerunning it without the “c” flag gave me the same number, so reason to do the compression, maybe bzip2 or other tools might do better if you need it.
As for the timing, I am using a MacBook Pro 2.4GHz I5 w/ 8GB Ram, regular HD; U3D not running: 12GB backup = 11m41.500s
Anyhow, for the first shot here is my script - which requires to run in a terminal window (cli), I recommend iTerm2.
The backup is placed into ~/UnityAssetStoreBackup
Here the source of the script:
----------- script: UnityAssetStoreBackup.sh ----------
#!/bin/sh
mkdir -p ~/UnityAssetStoreBackup
find ~/Library/Unity/ -type f -print0 | tar -cvf backup.tar --null -T -
file_name=backup.tar
current_time=$(date “+%Y.%m.%d-%H.%M.%S”)
echo “Current Time : $current_time”
new_fileName=$file_name.$current_time
echo "New FileName: " “$new_fileName”
cp $file_name $new_fileName
echo “You should see new file generated with timestamp on it…”
rm $file_name
echo “Temp file removed.”
echo “Backup complete!”
----------- end script: UnityAssetStoreBackup.sh ----------
Don’t forget to make the script executable with:
chmod +x UnityAssetStoreBackup.sh
Anyhow a regular “tar xvf backup.tar.gz.<2014.12.17-21.14.19 – timestamp>” should restore it.
I did not do a lot of testing, so please give feedback if you like!
I hope that helps!