[Mysolved] Backup with checksum comparison.
Posted: 07 Oct 2019 21:46
i hope i did search properly, 'cause i didn't find some script to be close to my needs(which actually made me surpriced). so i hope smb can help me with at least parts of code.
i'm in need of script that backups list of items to target folder, while checking if there are collisions. in case of collision files need to be compared by checksum. same checksum = no action/skip file, otherwise rename existing with adding modified date suffix to name and copy new.
eventually it will look like: file.ext, file-<modified_date>.ext, file-<modified_date>.ext, etc. so i need to have some way of cheking "suffixed files overload". if number of suffixed files(with same name but different suffixes) exceeds the number set in variable - delete the oldest suffixed file.
i'm in need of script that backups list of items to target folder, while checking if there are collisions. in case of collision files need to be compared by checksum. same checksum = no action/skip file, otherwise rename existing with adding modified date suffix to name and copy new.
eventually it will look like: file.ext, file-<modified_date>.ext, file-<modified_date>.ext, etc. so i need to have some way of cheking "suffixed files overload". if number of suffixed files(with same name but different suffixes) exceeds the number set in variable - delete the oldest suffixed file.