Hi,
i know the subject is hard to understand but i did my best with it.
the problem:
i have 2 HDs on my Ubuntu OS, the first is 1TB and the other is 500GB, i want to do a backup with rsync from my 1TB HDs (in with the Ubuntu is on it) to the 500GB.
on the 500GB i have a partition called Backup.
what i did:
i have created a user crontab that dose two things:
1. mount the Backup partition from the 500GB to a folder called /~/Backup on my home directory which is on the 1TB HD.
2. i wrote the proper rsync command for the backup to go.
that is my crontab, ('hanan' is the username):
Code:
SHELL=/bin/bash
MAILTO=hanan
33 3 * * * /bin/mount /dev/sdb2
34 3 * * * /usr/bin/rsync -r -t -v --progress --delete --size-only /home/hanan/Programs/Stuff/Printers/ /home/hanan/Backup/
the problem:
when the time for the crontab comes it mounts the Backup partition to the right location on the user's home directory, but it can't do the second step because it needs root privileges in order to write on the mounted HD.
i have tried that manually and still i can't copy any file to the mounted HD unless i do it with the sudo command.
am i missing something ?
i want to that via the CLI and cron just for the study experience.
thanks.