I am using Dropbox to have an online backup of some data. However I want to encrypt my data before uploading it to Dropbox. Therefore I have created a TrueCrypt container and I am using rsync to synchronize the original data with the data in the TrueCrypt container. The reason for this duplicative setup is because I want both hassle-free local access and an encrypted online backup.

However now on to my question. I wrote a script which uses rsync for the local synchronisation. I however do not want to execute it manually. Could someone tell me how I can run the script, say every 30 seconds, from the moment I login to my computer?

ps: I could always embed the current code of my script in a never-ending while loop and add sleep 30. However are there other more sophisticated ways?


It sounds like you want a cron job. Most cron daemons do not allow second resolution, but you could run a job every minute as root using something like the following in /etc/cron.d/encrypted-backup (assuming you want to run as root):

* * * * * root rsync [...]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.